Skip to content

Commit 52c6ef1

Browse files
authored
fix small string (#206)
1 parent c205648 commit 52c6ef1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

dub.sdl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name "mir-algorithm"
2-
description "Mir Algorithm Collection"
2+
description "Dlang Core Library"
33

44
authors "Ilya Yaroshenko" "Sebastian Wilzbach" "Andrei Alexandrescu and Phobos Team (original Phobos code)" "John Michael Hall"
5-
copyright "Copyright © 2016 - 2018, Ilya Yaroshenko; see also information per file."
5+
copyright "Copyright © 2016 - 2019, Ilya Yaroshenko; see also information per file."
66
license "BSL-1.0"
77

88
dependency "mir-core" version=">=0.3.5 <0.4.0"
@@ -24,5 +24,5 @@ configuration "default" {
2424
}
2525

2626
configuration "dips" {
27-
dflags "-dip25" "-dip1000" "-dip1008"
27+
dflags "-preview=dip1000" "-preview=dip1008"
2828
}

include/mir/small_string.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace mir
2323

2424
SmallString(const std::string& str) : SmallString((std::string_view)str) {}
2525
SmallString(const char* str) : SmallString(std::string_view(str)) {}
26-
std::string_view str() const noexcept { return std::string_view(_data, _data[maxLength] ? maxLength : std::strlen(_data)); }
26+
std::string_view str() const noexcept { return std::string_view(_data, _data[maxLength - 1] ? maxLength : std::strlen(_data)); }
2727
operator std::string_view() const noexcept { return str(); }
2828
operator bool() const noexcept { return _data[0] != 0; }
2929
bool operator !() const noexcept { return _data[0] == 0; }

0 commit comments

Comments
 (0)