Skip to content

Commit

Permalink
Fixed opApply bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ZILtoid1991 committed Oct 18, 2023
1 parent 05e51c1 commit d5a671e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ docs/
# Code coverage
*.lst

*.pdb
*.pdb

.history
8 changes: 4 additions & 4 deletions source/collections/treemap.d
Original file line number Diff line number Diff line change
Expand Up @@ -104,23 +104,23 @@ public struct TreeMap(K, E, bool nogcIndexing = true, alias less = "a < b") {
return "
int opApply(scope int delegate(ref E) " ~ attr ~ " dg) " ~ attr ~ " {
if(left !is null)
if(left.opApplyReverse(dg))
if(left.opApply(dg))
return 1;
if(dg(elem))
return 1;
if(right !is null)
if(right.opApplyReverse(dg))
if(right.opApply(dg))
return 1;
return 0;
}
int opApply(scope int delegate(K, ref E) " ~ attr ~ " dg) " ~ attr ~ " {
if(left !is null)
if(left.opApplyReverse(dg))
if(left.opApply(dg))
return 1;
if(dg(key, elem))
return 1;
if(right !is null)
if(right.opApplyReverse(dg))
if(right.opApply(dg))
return 1;
return 0;
}
Expand Down

0 comments on commit d5a671e

Please sign in to comment.