Skip to content

Commit

Permalink
Remove extra string cast from map (chapel-lang#22844)
Browse files Browse the repository at this point in the history
Removes the potential for a deprecation warning when accessing a map of
a non-primitive key type.

The `Map` module's `KeyNotFoundError` uses `string.format` to create
error message for keys of any type. However, one of map's `this`
assessors was casting the key to string when creating a
`KeyNotFoundError`, which can create a deprecation warning as of
chapel-lang#22068. This PR removes that
cast.

- [x] paratest

[ trivial - not reviewed ]
  • Loading branch information
jeremiah-corrado authored Jul 31, 2023
2 parents b78a3ef + 58df97d commit 40fcbd4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/standard/Map.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ module Map {

var (_, slot) = table.findAvailableSlot(k);
if !table.isSlotFull(slot) {
throw new KeyNotFoundError(k:string);
throw new KeyNotFoundError(k);
}
ref result = table.table[slot].val;
return result;
Expand Down

0 comments on commit 40fcbd4

Please sign in to comment.