mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-29 11:10:40 +00:00
under the hood, std::map::count() and std::map::contains() are nearly identical. both operations search for the given key witin the map. however, the former finds a equal range with the given key, and gets the distance between the disntance between the begin and the end of the range; while the later just searches with the given key. since scylla-nodetool is not a performance-critical application, the minor difference in efficiency between these two operations is unlikely to have a significant impact on its overall performance. while std::map::count() is generally suitable for our need, it might be beneficial to use a more appropriate API. in this change, we use std::map::contains() in the place of std::map::count() when checking for the existence of a paramter with given name. Signed-off-by: Kefu Chai <kefu.chai@scylladb.com> Closes scylladb/scylladb#20350