summaryrefslogtreecommitdiff
path: root/zen/zstring.cpp
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2020-07-22 16:56:03 +0000
committerB Stack <bgstack15@gmail.com>2020-07-22 16:56:03 +0000
commite5633fb1c0db91f01ab967330b76baf4ecdb0512 (patch)
tree10260e25ae905564f7978b83fc4e316670f987c6 /zen/zstring.cpp
parentMerge branch '10.25' into 'master' (diff)
parentadd upstream 11.0 (diff)
downloadFreeFileSync-e5633fb1c0db91f01ab967330b76baf4ecdb0512.tar.gz
FreeFileSync-e5633fb1c0db91f01ab967330b76baf4ecdb0512.tar.bz2
FreeFileSync-e5633fb1c0db91f01ab967330b76baf4ecdb0512.zip
Merge branch '11.0' into 'master'11.0
add upstream 11.0 See merge request opensource-tracking/FreeFileSync!24
Diffstat (limited to 'zen/zstring.cpp')
-rw-r--r--zen/zstring.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/zen/zstring.cpp b/zen/zstring.cpp
index 690f004b..b78bc118 100644
--- a/zen/zstring.cpp
+++ b/zen/zstring.cpp
@@ -14,7 +14,7 @@
using namespace zen;
-Zstring makeUpperCopy(const Zstring& str)
+Zstring getUpperCase(const Zstring& str)
{
//fast pre-check:
if (isAsciiString(str)) //perf: in the range of 3.5ns
@@ -81,7 +81,7 @@ Zstring replaceCpyAsciiNoCase(const Zstring& str, const Zstring& oldTerm, const
for (size_t pos = 0;;)
{
- const size_t posFound = std::search(str.begin() + pos, str.end(), //can't use makeUpperCopy(): input/output sizes may differ!
+ const size_t posFound = std::search(str.begin() + pos, str.end(), //can't use getUpperCase(): input/output sizes may differ!
oldTerm.begin(), oldTerm.end(),
[](Zchar charL, Zchar charR) { return asciiToUpper(charL) == asciiToUpper(charR); }) - str.begin();
@@ -100,8 +100,7 @@ Zstring replaceCpyAsciiNoCase(const Zstring& str, const Zstring& oldTerm, const
}
-/*
-https://docs.microsoft.com/de-de/windows/desktop/Intl/handling-sorting-in-your-applications
+/* https://docs.microsoft.com/de-de/windows/desktop/Intl/handling-sorting-in-your-applications
Perf test: compare strings 10 mio times; 64 bit build
-----------------------------------------------------
@@ -120,8 +119,8 @@ OS X (UTF8 char)
856 ns | CFStringCreateWithCString + CFStringCompare(kCFCompareCaseInsensitive)
1110 ns | CFStringCreateWithCStringNoCopy + CFStringCompare(kCFCompareCaseInsensitive)
________________________
-time per call | function
-*/
+time per call | function */
+
int compareNativePath(const Zstring& lhs, const Zstring& rhs)
{
assert(lhs.find(Zchar('\0')) == Zstring::npos); //don't expect embedded nulls!
bgstack15