From 83235bebebc8647ca8e4ae5a01424c51decbcbe4 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Sat, 6 Sep 2025 18:29:12 -0400 Subject: [PATCH] Cleanup: Pass StringRef instead of const std::string & No need to construct a std::string unless we're going to move from it. --- source/blender/editors/include/UI_interface.hh | 4 ++-- .../editors/interface/regions/interface_region_popup.cc | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/source/blender/editors/include/UI_interface.hh b/source/blender/editors/include/UI_interface.hh index 1d6f2157bdd..0281bedd064 100644 --- a/source/blender/editors/include/UI_interface.hh +++ b/source/blender/editors/include/UI_interface.hh @@ -297,7 +297,7 @@ blender::ui::AbstractTreeView *UI_block_add_view( std::unique_ptr tree_view); void UI_alert(bContext *C, - const std::string &title, - const std::string &message, + blender::StringRef title, + blender::StringRef message, eAlertIcon icon, bool compact); diff --git a/source/blender/editors/interface/regions/interface_region_popup.cc b/source/blender/editors/interface/regions/interface_region_popup.cc index 3ec45ec50a6..ed747c101fb 100644 --- a/source/blender/editors/interface/regions/interface_region_popup.cc +++ b/source/blender/editors/interface/regions/interface_region_popup.cc @@ -35,6 +35,8 @@ #include "interface_intern.hh" #include "interface_regions_intern.hh" +using blender::StringRef; + /* -------------------------------------------------------------------- */ /** \name Utility Functions * \{ */ @@ -1124,8 +1126,8 @@ static uiBlock *ui_alert_create(bContext *C, ARegion *region, void *user_data) } void UI_alert(bContext *C, - const std::string &title, - const std::string &message, + const StringRef title, + const StringRef message, const eAlertIcon icon, const bool compact) {