summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibChess
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2023-01-26 18:58:09 +0000
committerLinus Groh <mail@linusgroh.de>2023-01-27 20:38:49 +0000
commit6e7459322d8336bfe52e390ab4a1b2e82e24c05e (patch)
tree6da4b3a89764a22a1c62eabfa5fc5ee954519c41 /Userland/Libraries/LibChess
parentda81041e97d0fc7d37a985ce6ca4ded19ce2cdd1 (diff)
downloadserenity-6e7459322d8336bfe52e390ab4a1b2e82e24c05e.zip
AK: Remove StringBuilder::build() in favor of to_deprecated_string()
Having an alias function that only wraps another one is silly, and keeping the more obvious name should flush out more uses of deprecated strings. No behavior change.
Diffstat (limited to 'Userland/Libraries/LibChess')
-rw-r--r--Userland/Libraries/LibChess/Chess.cpp6
-rw-r--r--Userland/Libraries/LibChess/UCICommand.cpp14
2 files changed, 10 insertions, 10 deletions
diff --git a/Userland/Libraries/LibChess/Chess.cpp b/Userland/Libraries/LibChess/Chess.cpp
index 53aeee2501..b036dabc07 100644
--- a/Userland/Libraries/LibChess/Chess.cpp
+++ b/Userland/Libraries/LibChess/Chess.cpp
@@ -82,7 +82,7 @@ DeprecatedString Square::to_algebraic() const
StringBuilder builder;
builder.append(file + 'a');
builder.append(rank + '1');
- return builder.build();
+ return builder.to_deprecated_string();
}
Move::Move(StringView long_algebraic)
@@ -98,7 +98,7 @@ DeprecatedString Move::to_long_algebraic() const
builder.append(from.to_algebraic());
builder.append(to.to_algebraic());
builder.append(char_for_piece(promote_to).to_lowercase());
- return builder.build();
+ return builder.to_deprecated_string();
}
Move Move::from_algebraic(StringView algebraic, const Color turn, Board const& board)
@@ -216,7 +216,7 @@ DeprecatedString Move::to_algebraic() const
else if (is_check)
builder.append('+');
- return builder.build();
+ return builder.to_deprecated_string();
}
Board::Board()
diff --git a/Userland/Libraries/LibChess/UCICommand.cpp b/Userland/Libraries/LibChess/UCICommand.cpp
index 3553ca3b69..a53d7367d8 100644
--- a/Userland/Libraries/LibChess/UCICommand.cpp
+++ b/Userland/Libraries/LibChess/UCICommand.cpp
@@ -105,7 +105,7 @@ DeprecatedString SetOptionCommand::to_deprecated_string() const
builder.append(value().value());
}
builder.append('\n');
- return builder.build();
+ return builder.to_deprecated_string();
}
PositionCommand PositionCommand::from_string(StringView command)
@@ -141,7 +141,7 @@ DeprecatedString PositionCommand::to_deprecated_string() const
builder.append(move.to_long_algebraic());
}
builder.append('\n');
- return builder.build();
+ return builder.to_deprecated_string();
}
GoCommand GoCommand::from_string(StringView command)
@@ -227,7 +227,7 @@ DeprecatedString GoCommand::to_deprecated_string() const
builder.append(" infinite"sv);
builder.append('\n');
- return builder.build();
+ return builder.to_deprecated_string();
}
StopCommand StopCommand::from_string(StringView command)
@@ -256,9 +256,9 @@ IdCommand IdCommand::from_string(StringView command)
}
if (tokens[1] == "name") {
- return IdCommand(Type::Name, value.build());
+ return IdCommand(Type::Name, value.to_deprecated_string());
} else if (tokens[1] == "author") {
- return IdCommand(Type::Author, value.build());
+ return IdCommand(Type::Author, value.to_deprecated_string());
}
VERIFY_NOT_REACHED();
}
@@ -274,7 +274,7 @@ DeprecatedString IdCommand::to_deprecated_string() const
}
builder.append(value());
builder.append('\n');
- return builder.build();
+ return builder.to_deprecated_string();
}
UCIOkCommand UCIOkCommand::from_string(StringView command)
@@ -317,7 +317,7 @@ DeprecatedString BestMoveCommand::to_deprecated_string() const
builder.append("bestmove "sv);
builder.append(move().to_long_algebraic());
builder.append('\n');
- return builder.build();
+ return builder.to_deprecated_string();
}
InfoCommand InfoCommand::from_string([[maybe_unused]] StringView command)