@@ -2016,17 +2016,17 @@ concept persistent_with_common_getter = is_persistent_v<T> && requires(T t) {
20162016template <typename R, typename T, persistent_with_common_getter<R> C>
20172017ColumnGetterFunction<R, T> createGetterPtr (const std::string_view& columnLabel)
20182018{
2019- return std::strncmp ( columnLabel. data (), C::columnLabel (), columnLabel. size ()) ? nullptr : &getColumnValue<R, T, C>;
2019+ return columnLabel == C::columnLabel () ? &getColumnValue<R, T, C> : nullptr ;
20202020}
20212021
20222022template <typename R, typename T, dynamic_with_common_getter<R> C>
20232023ColumnGetterFunction<R, T> createGetterPtr (const std::string_view& columnLabel)
20242024{
20252025 // allows user to use consistent formatting (with prefix) of all column labels
2026- // by default there isn't 'f' prefix for dynamic column labels, strncmp(x,y,0) is always 0
2027- bool isPrefixMatch = columnLabel.size () > 1 && ! std::strncmp ( columnLabel.substr (1 ). data (), C::columnLabel (), columnLabel. size () - 1 );
2026+ // by default there isn't 'f' prefix for dynamic column labels
2027+ bool isPrefixMatch = columnLabel.size () > 1 && columnLabel.substr (1 ) == C::columnLabel ();
20282028 // check also exact match if user is aware of prefix missing
2029- bool isExactMatch = ! std::strncmp ( columnLabel. data (), C::columnLabel (), columnLabel. size () );
2029+ bool isExactMatch = columnLabel == C::columnLabel ();
20302030
20312031 return (isPrefixMatch || isExactMatch) ? &getColumnValue<R, T, C> : nullptr ;
20322032}
0 commit comments