Skip to content

Commit

Permalink
Add no-op for parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardehrenfried committed Nov 5, 2024
1 parent 52cbc82 commit cde6aeb
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public class OsmWithTags {

private static final Set<String> LEVEL_TAGS = Set.of("level", "layer");
private static final Set<String> DEFAULT_LEVEL = Set.of("0");
private static final Consumer<String> NO_OP = (i) -> {};

/* To save memory this is only created when an entity actually has tags. */
private Map<String, String> tags;
Expand Down Expand Up @@ -230,7 +231,7 @@ public OptionalInt getTagAsInt(String tag, Consumer<String> errorHandler) {
* Everything else is returned as an emtpy optional.
*/
public OptionalInt parseIntOrBoolean(String tag, Consumer<String> errorHandler) {
var maybeInt = getTagAsInt(tag, errorHandler);
var maybeInt = getTagAsInt(tag, NO_OP);
if (maybeInt.isPresent()) {
return maybeInt;
} else {
Expand Down

0 comments on commit cde6aeb

Please sign in to comment.