diff options
author | Hein-Pieter van Braam <hp@tmm.cx> | 2018-07-26 01:26:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-26 01:26:46 +0200 |
commit | 832e2bfcd38965a01a9149d509169dd197e42f58 (patch) | |
tree | 18b7ff35f1eeee39031a16e9c1d834ebf03d44cf /editor/editor_export.cpp | |
parent | 9423f23ffb80c946dec380f73f3f313ec44d0d18 (diff) | |
parent | 0e29f7974b59e4440cf02e1388fb9d8ab2b5c5fd (diff) |
Merge pull request #20137 from hpvb/reduce-vector-cow
Reduce unnecessary COW on Vector by make writing explicit
Diffstat (limited to 'editor/editor_export.cpp')
-rw-r--r-- | editor/editor_export.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp index 317fffad64..5c911a00ca 100644 --- a/editor/editor_export.cpp +++ b/editor/editor_export.cpp @@ -187,7 +187,7 @@ void EditorExportPreset::remove_patch(int p_idx) { void EditorExportPreset::set_patch(int p_index, const String &p_path) { ERR_FAIL_INDEX(p_index, patches.size()); - patches[p_index] = p_path; + patches.write[p_index] = p_path; EditorExport::singleton->save_presets(); } String EditorExportPreset::get_patch(int p_index) { @@ -295,7 +295,7 @@ Error EditorExportPlatform::_save_pack_file(void *p_userdata, const String &p_pa MD5Final(&ctx); sd.md5.resize(16); for (int i = 0; i < 16; i++) { - sd.md5[i] = ctx.digest[i]; + sd.md5.write[i] = ctx.digest[i]; } } @@ -584,9 +584,9 @@ EditorExportPlatform::ExportNotifier::ExportNotifier(EditorExportPlatform &p_pla //initial export plugin callback for (int i = 0; i < export_plugins.size(); i++) { if (export_plugins[i]->get_script_instance()) { //script based - export_plugins[i]->_export_begin_script(features.features_pv, p_debug, p_path, p_flags); + export_plugins.write[i]->_export_begin_script(features.features_pv, p_debug, p_path, p_flags); } else { - export_plugins[i]->_export_begin(features.features, p_debug, p_path, p_flags); + export_plugins.write[i]->_export_begin(features.features, p_debug, p_path, p_flags); } } } @@ -594,7 +594,7 @@ EditorExportPlatform::ExportNotifier::ExportNotifier(EditorExportPlatform &p_pla EditorExportPlatform::ExportNotifier::~ExportNotifier() { Vector<Ref<EditorExportPlugin> > export_plugins = EditorExport::get_singleton()->get_export_plugins(); for (int i = 0; i < export_plugins.size(); i++) { - export_plugins[i]->_export_end(); + export_plugins.write[i]->_export_end(); } } @@ -632,7 +632,7 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> & p_func(p_udata, export_plugins[i]->extra_files[j].path, export_plugins[i]->extra_files[j].data, 0, paths.size()); } - export_plugins[i]->_clear(); + export_plugins.write[i]->_clear(); } FeatureContainers feature_containers = get_feature_containers(p_preset); @@ -687,9 +687,9 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> & bool do_export = true; for (int i = 0; i < export_plugins.size(); i++) { if (export_plugins[i]->get_script_instance()) { //script based - export_plugins[i]->_export_file_script(path, type, features_pv); + export_plugins.write[i]->_export_file_script(path, type, features_pv); } else { - export_plugins[i]->_export_file(path, type, features); + export_plugins.write[i]->_export_file(path, type, features); } if (p_so_func) { for (int j = 0; j < export_plugins[i]->shared_objects.size(); j++) { @@ -709,7 +709,7 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> & if (export_plugins[i]->skipped) { do_export = false; } - export_plugins[i]->_clear(); + export_plugins.write[i]->_clear(); if (!do_export) break; //apologies, not exporting @@ -751,7 +751,7 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> & Vector<uint8_t> new_file; new_file.resize(utf8.length()); for (int j = 0; j < utf8.length(); j++) { - new_file[j] = utf8[j]; + new_file.write[j] = utf8[j]; } p_func(p_udata, from + ".remap", new_file, idx, total); @@ -1130,7 +1130,7 @@ void EditorExport::load_config() { for (int i = 0; i < export_platforms.size(); i++) { if (export_platforms[i]->get_name() == platform) { - preset = export_platforms[i]->create_preset(); + preset = export_platforms.write[i]->create_preset(); break; } } @@ -1203,7 +1203,7 @@ bool EditorExport::poll_export_platforms() { bool changed = false; for (int i = 0; i < export_platforms.size(); i++) { - if (export_platforms[i]->poll_devices()) { + if (export_platforms.write[i]->poll_devices()) { changed = true; } } |