Skip to content

Commit

Permalink
perf: avoid unnecessary string copying when calling static properties…
Browse files Browse the repository at this point in the history
… of interfaces
  • Loading branch information
edusperoni committed Jun 28, 2023
1 parent 88ce2d8 commit 8b53d02
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#include "DesugaredInterfaceCompanionClassNameResolver.h"

std::string DesugaredInterfaceCompanionClassNameResolver::resolveD8InterfaceCompanionClassName(
std::string interfaceName) {
const std::string& interfaceName) {
return interfaceName + D8_COMPANION_CLASS_SUFFIX;
}

std::string DesugaredInterfaceCompanionClassNameResolver::resolveBazelInterfaceCompanionClassName(
std::string interfaceName) {
const std::string& interfaceName) {
return interfaceName + BAZEL_COMPANION_CLASS_SUFFIX;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
class DesugaredInterfaceCompanionClassNameResolver {

public:
std::string resolveD8InterfaceCompanionClassName(std::string interfaceName);
std::string resolveD8InterfaceCompanionClassName(const std::string& interfaceName);

std::string resolveBazelInterfaceCompanionClassName(std::string interfaceName);
std::string resolveBazelInterfaceCompanionClassName(const std::string& interfaceName);

private:
const std::string BAZEL_COMPANION_CLASS_SUFFIX = "$$CC";
Expand Down

0 comments on commit 8b53d02

Please sign in to comment.