MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / uniquePath

Function uniquePath

lib/llvm/codegen.cpp:153–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151}
152
153std::filesystem::path uniquePath(const std::filesystem::path Model) noexcept {
154 using size_type = std::filesystem::path::string_type::size_type;
155 using value_type = std::filesystem::path::value_type;
156 static const auto Hex = "0123456789abcdef"sv;
157 std::uniform_int_distribution<size_type> Distribution(0, Hex.size() - 1);
158 auto String = Model.native();
159 for (size_type N = String.size(), I = 0; I < N; ++I) {
160 if (String[I] == static_cast<value_type>('%')) {
161 String[I] = static_cast<value_type>(Hex[Distribution(Hash::RandEngine)]);
162 }
163 }
164 return String;
165}
166
167std::filesystem::path createTemp(const std::filesystem::path Model) noexcept {
168 while (true) {

Callers 1

createTempFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected