mirror of
https://git.h3cjp.net/H3cJP/citra.git
synced 2024-11-23 02:42:57 +00:00
video_core: reduce string allocations in shader decompiler (#5261)
* video_core: reduce string allocations in shader decompiler * use append for indentation instead of resize Co-authored-by: Mat M. <mathew1800@gmail.com>
This commit is contained in:
parent
b82d4315fe
commit
db5b8b9c88
|
@ -196,12 +196,13 @@ private:
|
|||
|
||||
class ShaderWriter {
|
||||
public:
|
||||
void AddLine(const std::string& text) {
|
||||
void AddLine(std::string_view text) {
|
||||
DEBUG_ASSERT(scope >= 0);
|
||||
if (!text.empty()) {
|
||||
shader_source += std::string(static_cast<std::size_t>(scope) * 4, ' ');
|
||||
shader_source.append(static_cast<std::size_t>(scope) * 4, ' ');
|
||||
}
|
||||
shader_source += text + '\n';
|
||||
shader_source += text;
|
||||
shader_source += '\n';
|
||||
}
|
||||
|
||||
std::string MoveResult() {
|
||||
|
|
Loading…
Reference in a new issue