Skip to content

Commit

Permalink
Use onRangeError in StringMap.opIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
nordlow committed Dec 9, 2021
1 parent b21ff32 commit e5ed160
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions source/mir/string_map.d
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,9 @@ struct StringMap(T, U = uint)
assert (index < length);
return implementation._values[index];
}
import mir.exception: MirException;
throw new MirException("No member: ", key);
import core.exception : onRangeError;
onRangeError();
return implementation._values[0]; // TODO: remove when onRangeError is noreturn
}

version(mir_test) static if (is(T == int))
Expand Down

0 comments on commit e5ed160

Please sign in to comment.