aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/UniqueString.h
diff options
context:
space:
mode:
authormitchell <unknown>2019-04-17 00:22:27 -0400
committermitchell <unknown>2019-04-17 00:22:27 -0400
commit5746a0c90259cd39255749a33389b2854100905b (patch)
tree1adec96f4f20b866b5c8babbc21dc30aa80c5a98 /src/UniqueString.h
parent639b77a3634190cb6b8ea2e93896b10449a4f687 (diff)
downloadscintilla-mirror-5746a0c90259cd39255749a33389b2854100905b.tar.gz
Backport: Move UniqueStringCopy into its own source file UniqueString.cxx to hide the implementation.
Backport of changeset 7402:751b76b567f9, but with an alternative to C++17's string_view.
Diffstat (limited to 'src/UniqueString.h')
-rw-r--r--src/UniqueString.h10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/UniqueString.h b/src/UniqueString.h
index 8d95cb1ab..44ba26652 100644
--- a/src/UniqueString.h
+++ b/src/UniqueString.h
@@ -19,15 +19,7 @@ using UniqueString = std::unique_ptr<const char[]>;
/// Equivalent to strdup but produces a std::unique_ptr<const char[]> allocation to go
/// into collections.
-inline UniqueString UniqueStringCopy(const char *text) {
- if (!text) {
- return UniqueString();
- }
- const size_t len = strlen(text);
- char *sNew = new char[len + 1];
- std::copy(text, text + len + 1, sNew);
- return UniqueString(sNew);
-}
+UniqueString UniqueStringCopy(const char *text);
}