Skip to content

Commit

Permalink
Merge pull request #61110 from rburing/project_settings_use_rbmap
Browse files Browse the repository at this point in the history
  • Loading branch information
akien-mga authored May 17, 2022
2 parents 35004ae + 9d9b508 commit 7ea8cde
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions core/config/project_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ Error ProjectSettings::save() {
return error;
}

Error ProjectSettings::_save_settings_binary(const String &p_file, const HashMap<String, List<String>> &props, const CustomMap &p_custom, const String &p_custom_features) {
Error ProjectSettings::_save_settings_binary(const String &p_file, const RBMap<String, List<String>> &props, const CustomMap &p_custom, const String &p_custom_features) {
Error err;
Ref<FileAccess> file = FileAccess::open(p_file, FileAccess::WRITE, &err);
ERR_FAIL_COND_V_MSG(err != OK, err, "Couldn't save project.binary at " + p_file + ".");
Expand Down Expand Up @@ -832,7 +832,7 @@ Error ProjectSettings::_save_settings_binary(const String &p_file, const HashMap
return OK;
}

Error ProjectSettings::_save_settings_text(const String &p_file, const HashMap<String, List<String>> &props, const CustomMap &p_custom, const String &p_custom_features) {
Error ProjectSettings::_save_settings_text(const String &p_file, const RBMap<String, List<String>> &props, const CustomMap &p_custom, const String &p_custom_features) {
Error err;
Ref<FileAccess> file = FileAccess::open(p_file, FileAccess::WRITE, &err);

Expand Down Expand Up @@ -947,7 +947,7 @@ Error ProjectSettings::save_custom(const String &p_path, const CustomMap &p_cust

for (const KeyValue<String, Variant> &E : p_custom) {
// Lookup global prop to store in the same order
HashMap<StringName, VariantContainer>::Iterator global_prop = props.find(E.key);
RBMap<StringName, VariantContainer>::Iterator global_prop = props.find(E.key);

_VCSort vc;
vc.name = E.key;
Expand All @@ -957,7 +957,7 @@ Error ProjectSettings::save_custom(const String &p_path, const CustomMap &p_cust
vclist.insert(vc);
}

HashMap<String, List<String>> props;
RBMap<String, List<String>> props;

for (RBSet<_VCSort>::Element *E = vclist.front(); E; E = E->next()) {
String category = E->get().name;
Expand Down
6 changes: 3 additions & 3 deletions core/config/project_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class ProjectSettings : public Object {
int last_builtin_order = 0;
uint64_t last_save_time = 0;

HashMap<StringName, VariantContainer> props;
RBMap<StringName, VariantContainer> props; // NOTE: Key order is used e.g. in the save_custom method.
String resource_path;
HashMap<StringName, PropertyInfo> custom_prop_info;
bool disable_feature_overrides = false;
Expand All @@ -108,8 +108,8 @@ class ProjectSettings : public Object {
Error _load_settings_binary(const String &p_path);
Error _load_settings_text_or_binary(const String &p_text_path, const String &p_bin_path);

Error _save_settings_text(const String &p_file, const HashMap<String, List<String>> &props, const CustomMap &p_custom = CustomMap(), const String &p_custom_features = String());
Error _save_settings_binary(const String &p_file, const HashMap<String, List<String>> &props, const CustomMap &p_custom = CustomMap(), const String &p_custom_features = String());
Error _save_settings_text(const String &p_file, const RBMap<String, List<String>> &props, const CustomMap &p_custom = CustomMap(), const String &p_custom_features = String());
Error _save_settings_binary(const String &p_file, const RBMap<String, List<String>> &props, const CustomMap &p_custom = CustomMap(), const String &p_custom_features = String());

Error _save_custom_bnd(const String &p_file);

Expand Down

0 comments on commit 7ea8cde

Please sign in to comment.