Skip to content

Commit 668ed0d

Browse files
committed
RuleSet.cpp: Fix RuleSet::assignID return value regression
Commit 3672e9f changed the return value of `RuleSet::assignID` from "return x++" to "return ++x" which broke CI and skipped value 0. This commits restores the old behavior. This approach does not win prices in purity, elegance or performance, but performance doesn't matter in that function and you are invited to claim those prices for yourself if you can prvide a pull request that humans understand and that fully passes existing CI...
1 parent eb3d784 commit 668ed0d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Library/public/usbguard/RuleSet.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ namespace usbguard
228228
throw std::out_of_range("Rule ID too high");
229229
}
230230
_id_next = next_id;
231-
return next_id;
231+
return next_id - 1;
232232
}
233233

234234
void RuleSet::setWritable()

0 commit comments

Comments
 (0)