stringid: use string_view for accessors
This commit is contained in:
parent
c2f203b5a7
commit
5347fbb889
@ -42,7 +42,7 @@ stringid::add (std::string key)
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
stringid::id_t
|
||||
stringid::find (const std::string &key) const
|
||||
stringid::find (std::string_view const &key) const
|
||||
{
|
||||
auto pos = m_map.find (key);
|
||||
if (pos == m_map.end ())
|
||||
|
@ -43,7 +43,7 @@ namespace cruft {
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
id_t find (const std::string&) const;
|
||||
id_t find (std::string_view const&) const;
|
||||
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
@ -51,7 +51,7 @@ namespace cruft {
|
||||
id_t find (cruft::view<T> key) const
|
||||
{
|
||||
return find (
|
||||
std::string {
|
||||
std::string_view {
|
||||
std::cbegin (key),
|
||||
std::cend (key)
|
||||
}
|
||||
@ -64,7 +64,7 @@ namespace cruft {
|
||||
|
||||
|
||||
private:
|
||||
std::map<const std::string, id_t, std::less<>> m_map;
|
||||
std::map<std::string const, id_t, std::less<>> m_map;
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user