aboutsummaryrefslogtreecommitdiff
path: root/src/core/file_sys/kernel_executable.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-05-22 17:35:58 -0400
committerRodrigo Locatti <reinuseslisp@airmail.cc>2019-05-23 03:01:55 -0300
commit6dfd67b016d76ed190dda86876d995af49842881 (patch)
treec1f9c5abe823f0653d5a48fdffbc7993d28d3893 /src/core/file_sys/kernel_executable.cpp
parent9d3cbef5ce679ec1a316cefe5c57907b6573852d (diff)
shader/shader_ir: Make Comment() take a std::string by value
This allows for forming comment nodes without making unnecessary copies of the std::string instance. e.g. previously: Comment(fmt::format("Base address is c[0x{:x}][0x{:x}]", cbuf->GetIndex(), cbuf_offset)); Would result in a copy of the string being created, as CommentNode() takes a std::string by value (a const ref passed to a value parameter results in a copy). Now, only one instance of the string is ever moved around. (fmt::format returns a std::string, and since it's returned from a function by value, this is a prvalue (which can be treated like an rvalue), so it's moved into Comment's string parameter), we then move it into the CommentNode constructor, which then moves the string into its member variable).
Diffstat (limited to 'src/core/file_sys/kernel_executable.cpp')
0 files changed, 0 insertions, 0 deletions