Core/StringExt: Don't pass string_view by ref

https://quuxplusone.github.io/blog/2021/11/09/pass-string-view-by-value/
This commit is contained in:
SirLynix
2023-08-24 08:23:14 +02:00
parent 1b7a89213d
commit bd53245f42
51 changed files with 115 additions and 115 deletions

View File

@@ -208,7 +208,7 @@ namespace Nz::GL
virtual const Loader& GetLoader() = 0;
void OnContextRelease();
virtual bool ImplementFallback(const std::string_view& function);
virtual bool ImplementFallback(std::string_view function);
static void NotifyContextDestruction(Context* context);

View File

@@ -34,7 +34,7 @@ namespace Nz::GL
const Context* GetContext() const;
GLuint GetObjectId() const;
void SetDebugName(const std::string_view& name);
void SetDebugName(std::string_view name);
ContextObject& operator=(const ContextObject&) = delete;
ContextObject& operator=(ContextObject&& object) noexcept = default;

View File

@@ -85,7 +85,7 @@ namespace Nz::GL
}
template<typename C, GLenum ObjectType, typename... CreateArgs>
void ContextObject<C, ObjectType, CreateArgs...>::SetDebugName(const std::string_view& name)
void ContextObject<C, ObjectType, CreateArgs...>::SetDebugName(std::string_view name)
{
EnsureContext();

View File

@@ -35,7 +35,7 @@ namespace Nz::GL
OpenGLDevice* GetDevice() const;
GLuint GetObjectId() const;
void SetDebugName(const std::string_view& name);
void SetDebugName(std::string_view name);
DeviceObject& operator=(const DeviceObject&) = delete;
DeviceObject& operator=(DeviceObject&& object) noexcept = default;

View File

@@ -91,7 +91,7 @@ namespace Nz::GL
}
template<typename C, GLenum ObjectType, typename... CreateArgs>
void DeviceObject<C, ObjectType, CreateArgs...>::SetDebugName(const std::string_view& name)
void DeviceObject<C, ObjectType, CreateArgs...>::SetDebugName(std::string_view name)
{
const Context& context = EnsureDeviceContext();

View File

@@ -57,7 +57,7 @@ namespace Nz::GL
EGLSurface m_surface;
private:
bool ImplementFallback(const std::string_view& function) override;
bool ImplementFallback(std::string_view function) override;
bool Activate() const override;
void Desactivate() const override;

View File

@@ -41,7 +41,7 @@ namespace Nz::GL
static const char* TranslateError(EGLint errorId);
private:
bool ImplementFallback(const std::string_view& function);
bool ImplementFallback(std::string_view function);
ContextType m_preferredContextType;
EGLDisplay m_defaultDisplay;

View File

@@ -31,7 +31,7 @@ namespace Nz::GL
inline void SetBinarySource(GLenum binaryFormat, const void* binary, GLsizei length);
inline void SetSource(const char* source, GLint length);
inline void SetSource(const std::string_view& source);
inline void SetSource(std::string_view source);
// GL_ARB_gl_spirv
inline void SpecializeShader(const GLchar* pEntryPoint, GLuint numSpecializationConstants, const GLuint* pConstantIndex, const GLuint* pConstantValue);

View File

@@ -80,7 +80,7 @@ namespace Nz::GL
m_device->GetReferenceContext().glShaderSource(m_objectId, 1U, &source, &length);
}
inline void Shader::SetSource(const std::string_view& source)
inline void Shader::SetSource(std::string_view source)
{
return SetSource(source.data(), GLint(source.size()));
}

View File

@@ -47,7 +47,7 @@ namespace Nz::GL
private:
bool CreateInternal(const WGLContext* baseContext, const ContextParams& params, const WGLContext* shareContext = nullptr);
bool ImplementFallback(const std::string_view& function) override;
bool ImplementFallback(std::string_view function) override;
bool Activate() const override;
void Desactivate() const override;

View File

@@ -51,7 +51,7 @@ namespace Nz::GL
const WebLoader& m_loader;
private:
bool ImplementFallback(const std::string_view& function) override;
bool ImplementFallback(std::string_view function) override;
bool Activate() const override;
void Desactivate() const override;

View File

@@ -31,7 +31,7 @@ namespace Nz::GL
static const char* TranslateError(EMSCRIPTEN_RESULT errorId);
private:
bool ImplementFallback(const std::string_view& function);
bool ImplementFallback(std::string_view function);
};
}