OSDN Git Service
(root)
/
hengbandforosx
/
hengbandosx.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
940f381
)
[Refactor]フラグ読み込み関数にも適用させる
author
Slimebreath6078
<slimebreath6078@yahoo.co.jp>
Sun, 29 Oct 2023 15:21:36 +0000
(
00:21
+0900)
committer
Slimebreath6078
<slimebreath6078@yahoo.co.jp>
Wed, 1 Nov 2023 10:26:16 +0000
(19:26 +0900)
src/util/flag-group.h
patch
|
blob
|
history
diff --git
a/src/util/flag-group.h
b/src/util/flag-group.h
index
e59cc3d
..
462b04b
100644
(file)
--- a/
src/util/flag-group.h
+++ b/
src/util/flag-group.h
@@
-1,5
+1,6
@@
#pragma once
+#include "info-reader/info-reader-util.h"
#include <bitset>
#include <concepts>
#include <iterator>
@@
-592,13
+593,12
@@
public:
template <typename Map>
static bool grab_one_flag(FlagGroup<FlagType, MAX> &fg, const Map &dict, std::string_view what)
{
- auto it = dict.find(what);
- if (it == dict.end()) {
- return false;
+ auto val = info_get_const<FlagType>(dict, what);
+ if (val) {
+ fg.set(*val);
+ return true;
}
-
- fg.set(it->second);
- return true;
+ return false;
}
private: