mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 06:17:49 +00:00
Move OnChange callback in Option ctors
Parameter 'f' is passed by value and only copied once. Moving it to avoid unnecessary copies. closes https://github.com/official-stockfish/Stockfish/pull/5014 No functional change
This commit is contained in:
@@ -12,6 +12,7 @@ Hisayori Noda (nodchip)
|
|||||||
# All other authors of Stockfish code (in alphabetical order)
|
# All other authors of Stockfish code (in alphabetical order)
|
||||||
Aditya (absimaldata)
|
Aditya (absimaldata)
|
||||||
Adrian Petrescu (apetresc)
|
Adrian Petrescu (apetresc)
|
||||||
|
Ahmed Kerimov (wcdbmv)
|
||||||
Ajith Chandy Jose (ajithcj)
|
Ajith Chandy Jose (ajithcj)
|
||||||
Alain Savard (Rocky640)
|
Alain Savard (Rocky640)
|
||||||
Alayan Feh (Alayan-stk-2)
|
Alayan Feh (Alayan-stk-2)
|
||||||
|
|||||||
+5
-5
@@ -68,7 +68,7 @@ Option::Option(const char* v, OnChange f) :
|
|||||||
type("string"),
|
type("string"),
|
||||||
min(0),
|
min(0),
|
||||||
max(0),
|
max(0),
|
||||||
on_change(f) {
|
on_change(std::move(f)) {
|
||||||
defaultValue = currentValue = v;
|
defaultValue = currentValue = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ Option::Option(bool v, OnChange f) :
|
|||||||
type("check"),
|
type("check"),
|
||||||
min(0),
|
min(0),
|
||||||
max(0),
|
max(0),
|
||||||
on_change(f) {
|
on_change(std::move(f)) {
|
||||||
defaultValue = currentValue = (v ? "true" : "false");
|
defaultValue = currentValue = (v ? "true" : "false");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,13 +84,13 @@ Option::Option(OnChange f) :
|
|||||||
type("button"),
|
type("button"),
|
||||||
min(0),
|
min(0),
|
||||||
max(0),
|
max(0),
|
||||||
on_change(f) {}
|
on_change(std::move(f)) {}
|
||||||
|
|
||||||
Option::Option(double v, int minv, int maxv, OnChange f) :
|
Option::Option(double v, int minv, int maxv, OnChange f) :
|
||||||
type("spin"),
|
type("spin"),
|
||||||
min(minv),
|
min(minv),
|
||||||
max(maxv),
|
max(maxv),
|
||||||
on_change(f) {
|
on_change(std::move(f)) {
|
||||||
defaultValue = currentValue = std::to_string(v);
|
defaultValue = currentValue = std::to_string(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,7 +98,7 @@ Option::Option(const char* v, const char* cur, OnChange f) :
|
|||||||
type("combo"),
|
type("combo"),
|
||||||
min(0),
|
min(0),
|
||||||
max(0),
|
max(0),
|
||||||
on_change(f) {
|
on_change(std::move(f)) {
|
||||||
defaultValue = v;
|
defaultValue = v;
|
||||||
currentValue = cur;
|
currentValue = cur;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user