Skip to content

Commit a7ea8d0

Browse files
committed
chore: add better description for short circuiting
1 parent 5e1474a commit a7ea8d0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/bench/custom/benchmarks.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ const ObjectId_isValid = [
55
function objectid_isvalid_strlen() {
66
BSON.ObjectId.isValid('a');
77
},
8-
function objectid_isvalid_bestcase_false() {
8+
/** wrong character at the start */
9+
function objectid_isvalid_most_short_circuit_false() {
910
BSON.ObjectId.isValid('g6e84ebdc96f4c0772f0cbbf');
1011
},
11-
function objectid_isvalid_worstcase_false() {
12+
/** wrong character at the end */
13+
function objectid_isvalid_least_short_circuit_false() {
1214
BSON.ObjectId.isValid('66e84ebdc96f4c0772f0cbbg');
1315
},
1416
function objectid_isvalid_true() {

0 commit comments

Comments
 (0)