-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Symforce] Add a SetNew method that throws if key already exists
This is useful when setting up the initial values of a problem, the function will throw if one accidentally set the same key twice, which is usually a mistake. The SetNew() method was implemented using the existing Set() function. The only downside is that the value of the existing key will be overwritten when the exception is thrown. The alternative would be to basically re-implement SetInternal(), which I think is not worth it. Topic: chaoqu_symforce_set_unique GitOrigin-RevId: c3ff57ae0d5f2e3eae9951f63f94d9d3daf75f00
- Loading branch information
1 parent
e833903
commit 4539394
Showing
3 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters