diff options
author | Tor Brede Vekterli <vekterli@oath.com> | 2018-07-26 11:18:49 +0000 |
---|---|---|
committer | Tor Brede Vekterli <vekterli@oath.com> | 2018-07-26 11:18:49 +0000 |
commit | 5037bb7c8c9de94337c0d5bc1b831145f69ec9a3 (patch) | |
tree | cac15fcbded5e2be67d2783c2eb28ba03b47e1ba /document/src | |
parent | 12c8f3005e202b31a8e0ff3816ce9d714a269046 (diff) |
Don't string wrap refs that are guaranteed to be zero-terminated
Diffstat (limited to 'document/src')
5 files changed, 7 insertions, 7 deletions
diff --git a/document/src/vespa/document/base/field.cpp b/document/src/vespa/document/base/field.cpp index 7ce766c47c6..578294df7b0 100644 --- a/document/src/vespa/document/base/field.cpp +++ b/document/src/vespa/document/base/field.cpp @@ -91,7 +91,7 @@ Field::validateId(int newId) { throw vespalib::IllegalArgumentException(vespalib::make_string( "Attempt to set the id of %s to %d failed, values from " "100 to 127 are reserved for internal use", - vespalib::string(getName()).c_str(), newId)); + getName().data(), newId)); } if ((newId & 0x80000000) != 0) // Highest bit must not be set @@ -99,7 +99,7 @@ Field::validateId(int newId) { throw vespalib::IllegalArgumentException(vespalib::make_string( "Attempt to set the id of %s to %d" " failed, negative id values are illegal", - vespalib::string(getName()).c_str(), newId)); + getName().data(), newId)); } } diff --git a/document/src/vespa/document/datatype/documenttype.cpp b/document/src/vespa/document/datatype/documenttype.cpp index 31485aa42b6..2be5acaf3db 100644 --- a/document/src/vespa/document/datatype/documenttype.cpp +++ b/document/src/vespa/document/datatype/documenttype.cpp @@ -96,7 +96,7 @@ DocumentType::addField(const Field& field) } else if (!_ownedFields.get()) { throw vespalib::IllegalStateException(make_string( "Cannot add field %s to a DocumentType that does not " - "own its fields.", vespalib::string(field.getName()).c_str()), VESPA_STRLOC); + "own its fields.", field.getName().data()), VESPA_STRLOC); } _ownedFields->addField(field); } diff --git a/document/src/vespa/document/datatype/structdatatype.cpp b/document/src/vespa/document/datatype/structdatatype.cpp index 1303f16c43b..9ff0b7e0b0a 100644 --- a/document/src/vespa/document/datatype/structdatatype.cpp +++ b/document/src/vespa/document/datatype/structdatatype.cpp @@ -83,7 +83,7 @@ StructDataType::addField(const Field& field) vespalib::string error = containsConflictingField(field); if (error != "") { throw IllegalArgumentException(make_string("Failed to add field '%s' to struct '%s': %s", - vespalib::string(field.getName()).c_str(), getName().c_str(), + field.getName().data(), getName().c_str(), error.c_str()), VESPA_STRLOC); } if (hasField(field.getName())) { diff --git a/document/src/vespa/document/update/arithmeticvalueupdate.cpp b/document/src/vespa/document/update/arithmeticvalueupdate.cpp index 7363899d5cf..3af9350062e 100644 --- a/document/src/vespa/document/update/arithmeticvalueupdate.cpp +++ b/document/src/vespa/document/update/arithmeticvalueupdate.cpp @@ -35,7 +35,7 @@ ArithmeticValueUpdate::checkCompatibility(const Field& field) const if ( ! field.getDataType().inherits(NumericDataType::classId)) { throw IllegalArgumentException(vespalib::make_string( "Can not perform arithmetic update on non-numeric field '%s'.", - vespalib::string(field.getName()).c_str()), VESPA_STRLOC); + field.getName().data()), VESPA_STRLOC); } } diff --git a/document/src/vespa/document/update/mapvalueupdate.cpp b/document/src/vespa/document/update/mapvalueupdate.cpp index cc0aec3618a..be970b3c30a 100644 --- a/document/src/vespa/document/update/mapvalueupdate.cpp +++ b/document/src/vespa/document/update/mapvalueupdate.cpp @@ -46,7 +46,7 @@ MapValueUpdate::checkCompatibility(const Field& field) const if (_key->getClass().id() != IntFieldValue::classId) { throw IllegalArgumentException(vespalib::make_string( "Key for field '%s' is of wrong type (expected '%s', was '%s').", - vespalib::string(field.getName()).c_str(), DataType::INT->toString().c_str(), + field.getName().data(), DataType::INT->toString().c_str(), _key->getDataType()->toString().c_str()), VESPA_STRLOC); } } else if (field.getDataType().getClass().id() == WeightedSetDataType::classId) { @@ -54,7 +54,7 @@ MapValueUpdate::checkCompatibility(const Field& field) const if (!type.getNestedType().isValueType(*_key)) { throw IllegalArgumentException(vespalib::make_string( "Key for field '%s' is of wrong type (expected '%s', was '%s').", - vespalib::string(field.getName()).c_str(), DataType::INT->toString().c_str(), + field.getName().data(), DataType::INT->toString().c_str(), _key->getDataType()->toString().c_str()), VESPA_STRLOC); } } else { |