libexpr: rename confusing makeImmutableString -> gcCopyStringIfNeeded

The purpose of this function has little to do with immutability. Value's
strings are never mutated, and the point of this function is to
singleton empty strings.

Change-Id: Ifd41dd952409d54e4d3de9ab59064e6928b0e480
This commit is contained in:
Qyriad
2024-07-20 20:20:01 +00:00
parent a3361557e3
commit e67dac1d74
4 changed files with 32 additions and 18 deletions
+5
View File
@@ -7,6 +7,7 @@
#include <list>
#include <map>
#include <new>
#include <string_view>
#include <vector>
#if HAVE_BOEHMGC
@@ -116,4 +117,8 @@ inline char * gcAllocString(size_t size)
return cstr;
}
/// Returns a C-string copied from @ref toCopyFrom, or a single, static empty
/// string if @ref toCopyFrom is also empty.
char const * gcCopyStringIfNeeded(std::string_view toCopyFrom);
}