Skip to content

Commit e5ed160

Browse files
committedDec 9, 2021
Use onRangeError in StringMap.opIndex
1 parent b21ff32 commit e5ed160

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎source/mir/string_map.d

+3-2
Original file line numberDiff line numberDiff line change
@@ -542,8 +542,9 @@ struct StringMap(T, U = uint)
542542
assert (index < length);
543543
return implementation._values[index];
544544
}
545-
import mir.exception: MirException;
546-
throw new MirException("No member: ", key);
545+
import core.exception : onRangeError;
546+
onRangeError();
547+
return implementation._values[0]; // TODO: remove when onRangeError is noreturn
547548
}
548549

549550
version(mir_test) static if (is(T == int))

0 commit comments

Comments
 (0)
Failed to load comments.