diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2020-04-17 01:00:56 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2020-04-17 01:00:56 +0200 |
commit | 7a9687ba30d579bc51e0aaf3193e0ab8d86400d2 (patch) | |
tree | 3602fae070390a26f269e8071200d39e41eeb1b5 /src/libstore/sqlite.cc | |
parent | 3b489e8843f4730d4dd0753453ccb1c21429b0e9 (diff) |
SQLiteStmt: Use std::string_view
Diffstat (limited to 'src/libstore/sqlite.cc')
-rw-r--r-- | src/libstore/sqlite.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstore/sqlite.cc b/src/libstore/sqlite.cc index eb1daafc5..63527a811 100644 --- a/src/libstore/sqlite.cc +++ b/src/libstore/sqlite.cc @@ -95,10 +95,10 @@ SQLiteStmt::Use::~Use() sqlite3_reset(stmt); } -SQLiteStmt::Use & SQLiteStmt::Use::operator () (const std::string & value, bool notNull) +SQLiteStmt::Use & SQLiteStmt::Use::operator () (std::string_view value, bool notNull) { if (notNull) { - if (sqlite3_bind_text(stmt, curArg++, value.c_str(), -1, SQLITE_TRANSIENT) != SQLITE_OK) + if (sqlite3_bind_text(stmt, curArg++, value.data(), -1, SQLITE_TRANSIENT) != SQLITE_OK) throwSQLiteError(stmt.db, "binding argument"); } else bind(); |