Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josinSbazin/3e39399ed624f16de95f6951073b1c2b to your computer and use it in GitHub Desktop.
Save josinSbazin/3e39399ed624f16de95f6951073b1c2b to your computer and use it in GitHub Desktop.
Безопасное удаление с помощью итератора
for(Iterator<Map.Entry<String, String>> it = map.entrySet().iterator(); it.hasNext(); ) {
Map.Entry<String, String> entry = it.next();
if(entry.getKey().equals("remove_entry")) {
it.remove();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment