Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/game/StarItemRecipe.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/game/StarItemRecipe.cpp')
-rw-r--r--source/game/StarItemRecipe.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/game/StarItemRecipe.cpp b/source/game/StarItemRecipe.cpp
index 7295cd1..1ba4b70 100644
--- a/source/game/StarItemRecipe.cpp
+++ b/source/game/StarItemRecipe.cpp
@@ -5,9 +5,10 @@
namespace Star {
-Json ItemRecipe::toJson() {
+Json ItemRecipe::toJson() const {
JsonArray inputList;
- for (auto input : inputs)
+ inputList.reserve(inputList.size());
+ for (auto& input : inputs)
inputList.append(input.toJson());
return JsonObject{
@@ -21,7 +22,7 @@ Json ItemRecipe::toJson() {
};
}
-bool ItemRecipe::isNull() {
+bool ItemRecipe::isNull() const {
return currencyInputs.size() == 0 && inputs.size() == 0 && output.isNull();
}