Skip to content

Commit 9571e51

Browse files
committed
fix: improve string comparison
1 parent 796d042 commit 9571e51

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

package/cpp/types.hpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,16 @@ struct SQLiteExecuteQueryResult {
3232
};
3333

3434
// constexpr function that maps SQLiteColumnType to string literals
35-
constexpr ColumnType mapSQLiteTypeToColumnType(const char* type) {
36-
if (type == NULL) {
37-
return ColumnType::NULL_VALUE;
38-
} else if (*type == "BOOLEAN") {
35+
ColumnType mapSQLiteTypeToColumnType(const char* type) {
36+
if (strcmp(type, "BOOLEAN")) {
3937
return ColumnType::BOOLEAN;
40-
} else if (*type == "FLOAT") {
38+
} else if (strcmp(type, "FLOAT")) {
4139
return ColumnType::NUMBER;
42-
} else if (*type == "INTEGER") {
40+
} else if (strcmp(type, "INTEGER")) {
4341
return ColumnType::INT64;
44-
} else if (*type == "TEXT") {
42+
} else if (strcmp(type, "TEXT")) {
4543
return ColumnType::TEXT;
46-
} else if (*type == "BLOB") {
44+
} else if (strcmp(type, "BLOB")) {
4745
return ColumnType::ARRAY_BUFFER;
4846
} else {
4947
return ColumnType::NULL_VALUE;

0 commit comments

Comments
 (0)