Skip to content

Commit

Permalink
Possible performance improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
mls-m5 committed Nov 22, 2023
1 parent 4883f3b commit c78338f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/text/cursorrangeops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ std::vector<FString> contentLines(CursorRange range) {
auto &buffer = begin.buffer();

if (begin.y() == end.y()) {
auto line = buffer.lineAt(begin.y());
auto &line = buffer.lineAt(begin.y());
return {{line.begin() + begin.x(), line.begin() + end.x()}};
}

Expand Down
2 changes: 1 addition & 1 deletion src/text/fstring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ std::vector<FString> FString::split(Utf8Char c) const {
return ret;
}

FString FString::join(std::vector<FString> strings, Utf8Char c) {
FString FString::join(const std::vector<FString> &strings, Utf8Char c) {

size_t size = strings.size() - 1;

Expand Down
2 changes: 1 addition & 1 deletion src/text/fstring.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class FString {

std::vector<FString> split(Utf8Char c = '\n') const;

static FString join(std::vector<FString> strings, Utf8Char c = '\n');
static FString join(const std::vector<FString> &strings, Utf8Char c = '\n');

FString operator+(const FString &other);

Expand Down

0 comments on commit c78338f

Please sign in to comment.