diff --git a/Userland/Libraries/LibSQL/Tuple.cpp b/Userland/Libraries/LibSQL/Tuple.cpp index 04fa97813f..c0dc6cc9e4 100644 --- a/Userland/Libraries/LibSQL/Tuple.cpp +++ b/Userland/Libraries/LibSQL/Tuple.cpp @@ -79,13 +79,12 @@ Tuple& Tuple::operator=(Tuple const& other) return *this; } -Optional Tuple::index_of(String name) const +Optional Tuple::index_of(StringView name) const { - auto n = move(name); for (auto ix = 0u; ix < m_descriptor->size(); ix++) { auto& part = (*m_descriptor)[ix]; - if (part.name == n) { - return (int)ix; + if (part.name == name) { + return ix; } } return {}; diff --git a/Userland/Libraries/LibSQL/Tuple.h b/Userland/Libraries/LibSQL/Tuple.h index 0488128097..297510f7a5 100644 --- a/Userland/Libraries/LibSQL/Tuple.h +++ b/Userland/Libraries/LibSQL/Tuple.h @@ -70,7 +70,7 @@ public: [[nodiscard]] u32 hash() const; protected: - [[nodiscard]] Optional index_of(String) const; + [[nodiscard]] Optional index_of(StringView) const; void copy_from(Tuple const&); virtual void serialize(Serializer&) const; virtual void deserialize(Serializer&);