Skip to content

Commit dbcaafd

Browse files
committed
fix: major performance improvement for instance-wide uncommitted check
1 parent fcfa282 commit dbcaafd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

cls/SourceControl/Git/Change.cls

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,9 @@ ClassMethod InstanceUncommittedExecute(ByRef qHandle As %Binary) As %Status
217217
throw:SQLCODE<0 ##class(%Exception.SQL).CreateFromSQLCODE(SQLCODE, %msg)
218218
&sql(FETCH InstanceCursor)
219219
while(SQLCODE = 0) {
220-
set qHandle("changes", $increment(qHandle("changes")), "InternalName") = internalName
221-
set qHandle("changes", qHandle("changes"), "User") = changedBy
222-
set qHandle("changes", qHandle("changes"), "Namespace") = namespace
220+
set ^||InstanceUncommitted("changes", $increment(^||InstanceUncommitted("changes")), "InternalName") = internalName
221+
set ^||InstanceUncommitted("changes", ^||InstanceUncommitted("changes"), "User") = changedBy
222+
set ^||InstanceUncommitted("changes", ^||InstanceUncommitted("changes"), "Namespace") = namespace
223223
&sql(FETCH InstanceCursor)
224224
}
225225
&sql(CLOSE InstanceCursor)
@@ -232,10 +232,10 @@ ClassMethod InstanceUncommittedExecute(ByRef qHandle As %Binary) As %Status
232232
ClassMethod InstanceUncommittedFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) As %Status [ PlaceAfter = InstanceUncommittedExecute ]
233233
{
234234
set i = qHandle("i")
235-
if $data(qHandle("changes",i))=10 {
236-
set Row = $listbuild(qHandle("changes", i, "InternalName"), qHandle("changes", i, "User"), qHandle("changes", i, "Namespace"))
235+
if $data(^||InstanceUncommitted("changes",i))=10 {
236+
set Row = $listbuild(^||InstanceUncommitted("changes", i, "InternalName"), ^||InstanceUncommitted("changes", i, "User"), ^||InstanceUncommitted("changes", i, "Namespace"))
237237
}
238-
if i >= $get(qHandle("changes"),0) {
238+
if i >= $get(^||InstanceUncommitted("changes"),0) {
239239
set AtEnd = 1
240240
} else {
241241
set qHandle("i") = $increment(qHandle("i"))

0 commit comments

Comments
 (0)