Skip to content

Commit

Permalink
fix order of operations in opCmp
Browse files Browse the repository at this point in the history
  • Loading branch information
LunaTheFoxgirl committed Jun 1, 2024
1 parent a875fa4 commit a047fdb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/numem/mem/string.d
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,8 @@ public:
@trusted
int opCmp(S)(ref inout S s) inout if (is(S : basic_string!T)) {
import core.stdc.string : strncmp;
if (s.size() < this.size()) return -1;
if (s.size() > this.size()) return 1;
if (this.size() < s.size()) return -1;
if (this.size() > s.size()) return 1;
return strncmp(this.toCStringi(), s.toCStringi(), this.size());
}

Expand Down

0 comments on commit a047fdb

Please sign in to comment.