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:
@@ -38,7 +38,7 @@ namespace Nz
|
||||
OpenGLCommandBuffer(OpenGLCommandBuffer&&) = delete;
|
||||
~OpenGLCommandBuffer() = default;
|
||||
|
||||
inline void BeginDebugRegion(const std::string_view& regionName, const Color& color);
|
||||
inline void BeginDebugRegion(std::string_view regionName, const Color& color);
|
||||
|
||||
inline void BindComputePipeline(const OpenGLComputePipeline* pipeline);
|
||||
inline void BindComputeShaderBinding(const OpenGLRenderPipelineLayout& pipelineLayout, UInt32 set, const OpenGLShaderBinding* binding);
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace Nz
|
||||
{
|
||||
}
|
||||
|
||||
inline void OpenGLCommandBuffer::BeginDebugRegion(const std::string_view& regionName, const Color& color)
|
||||
inline void OpenGLCommandBuffer::BeginDebugRegion(std::string_view regionName, const Color& color)
|
||||
{
|
||||
BeginDebugRegionCommand beginDebugRegion;
|
||||
beginDebugRegion.color = color;
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Nz
|
||||
OpenGLCommandBufferBuilder(OpenGLCommandBufferBuilder&&) noexcept = default;
|
||||
~OpenGLCommandBufferBuilder() = default;
|
||||
|
||||
void BeginDebugRegion(const std::string_view& regionName, const Color& color) override;
|
||||
void BeginDebugRegion(std::string_view regionName, const Color& color) override;
|
||||
void BeginRenderPass(const Framebuffer& framebuffer, const RenderPass& renderPass, const Recti& renderRect, const ClearValues* clearValues, std::size_t clearValueCount) override;
|
||||
|
||||
void BindComputePipeline(const ComputePipeline& pipeline) override;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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()));
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user