[Scummvm-git-logs] scummvm master -> 7698d18a9bfad280d77232ea2f9f344781f12b58
grisenti
noreply at scummvm.org
Sat Jun 3 21:23:17 UTC 2023
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
7698d18a9b COMMON: Fix StableMap API to conform to std::map
Commit: 7698d18a9bfad280d77232ea2f9f344781f12b58
https://github.com/scummvm/scummvm/commit/7698d18a9bfad280d77232ea2f9f344781f12b58
Author: grisenti (emanuele at grisenti.net)
Date: 2023-06-03T23:23:09+02:00
Commit Message:
COMMON: Fix StableMap API to conform to std::map
Changed paths:
common/stablemap.h
diff --git a/common/stablemap.h b/common/stablemap.h
index ee0dbe981fb..6807b1791f7 100644
--- a/common/stablemap.h
+++ b/common/stablemap.h
@@ -145,12 +145,17 @@ public:
return _items.erase(first, last);
}
- /** Erases the item in the map pointed by @p it .*/
- iterator erase(const Key &theKey) {
+ /**
+ * Erases the item with the given key.
+ * Returns the number of elements removed (0 or 1)
+ */
+ size_t erase(const Key &theKey) {
iterator it = find(theKey);
- if (it != this->end())
- return erase(it);
- return it;
+ if (it != this->end()) {
+ erase(it);
+ return 1;
+ }
+ return 0;
}
/**
More information about the Scummvm-git-logs
mailing list