summaryrefslogtreecommitdiffstats
path: root/document
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-01-14 15:38:54 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2020-01-14 15:38:54 +0000
commit7e0c1731e36eb7048977ad14d6457182fb5ec4c1 (patch)
tree7a326f16f7cea1f95f5e66dff4c732b1ef4e755c /document
parentf0636713bd57f443dd486ff10296465327b333a1 (diff)
GC unused code
Diffstat (limited to 'document')
-rw-r--r--document/src/vespa/document/base/idstring.cpp20
-rw-r--r--document/src/vespa/document/base/idstring.h3
2 files changed, 6 insertions, 17 deletions
diff --git a/document/src/vespa/document/base/idstring.cpp b/document/src/vespa/document/base/idstring.cpp
index 05dc52475b7..1dcc11aa891 100644
--- a/document/src/vespa/document/base/idstring.cpp
+++ b/document/src/vespa/document/base/idstring.cpp
@@ -5,7 +5,6 @@
#include <vespa/document/bucket/bucketid.h>
#include <vespa/vespalib/util/md5.h>
#include <vespa/vespalib/util/stringfmt.h>
-#include <limits>
#include <cerrno>
using vespalib::string;
@@ -31,12 +30,6 @@ IdString::getTypeName(Type t)
return _G_typeName[t];
}
-string
-IdString::getSchemeName() const
-{
- return getTypeName(getType());
-}
-
const string &
IdString::toString() const
{
@@ -74,11 +67,6 @@ union FourByte {
uint32_t as32;
};
-union EightByte {
- char asChar[8];
- uint64_t as64;
-};
-
const FourByte _G_null = {{'n', 'u', 'l', 'l'}};
const TwoByte _G_id = {{'i', 'd'}};
@@ -128,7 +116,7 @@ fmemchr(const char * s, const char * e)
}
s++;
}
- return NULL;
+ return nullptr;
}
} // namespace
@@ -141,7 +129,7 @@ IdString::Offsets::Offsets(uint32_t maxComponents, uint32_t namespaceOffset, str
const char * s(id.data() + namespaceOffset);
const char * e(id.data() + id.size());
for(s=fmemchr(s, e);
- (s != NULL) && (index < maxComponents);
+ (s != nullptr) && (index < maxComponents);
s = fmemchr(s+1, e))
{
_offsets[index++] = s - id.data() + 1;
@@ -159,6 +147,8 @@ IdString::IdString(uint32_t maxComponents, uint32_t namespaceOffset, stringref r
{
}
+IdString::~IdString() = default;
+
void
IdString::validate() const
{
@@ -205,7 +195,7 @@ union LocationUnion {
};
uint64_t parseNumber(stringref number) {
- char* errPos = NULL;
+ char* errPos = nullptr;
errno = 0;
uint64_t n = strtoul(number.data(), &errPos, 10);
if (*errPos) {
diff --git a/document/src/vespa/document/base/idstring.h b/document/src/vespa/document/base/idstring.h
index cddf6d036b1..8e8cf0057dc 100644
--- a/document/src/vespa/document/base/idstring.h
+++ b/document/src/vespa/document/base/idstring.h
@@ -28,7 +28,7 @@ public:
static IdString::UP createIdString(const char *id, size_t sz);
static LocationType makeLocation(vespalib::stringref s);
- ~IdString() {}
+ ~IdString();
IdString* clone() const override = 0;
virtual Type getType() const = 0;
@@ -50,7 +50,6 @@ public:
protected:
IdString(uint32_t maxComponents, uint32_t namespaceOffset, vespalib::stringref rawId);
- virtual vespalib::string getSchemeName() const;
size_t offset(size_t index) const { return _offsets[index]; }
size_t size(size_t index) const { return _offsets[index+1] - _offsets[index] - 1; }
vespalib::stringref getComponent(size_t index) const { return vespalib::stringref(_rawId.c_str() + offset(index), size(index)); }