Cleanup: Pass StringRef instead of const std::string &

No need to construct a std::string unless we're going to move from it.
This commit is contained in:
Hans Goudey
2025-09-06 18:29:12 -04:00
parent f2b61b0874
commit 83235bebeb
2 changed files with 6 additions and 4 deletions

View File

@@ -297,7 +297,7 @@ blender::ui::AbstractTreeView *UI_block_add_view(
std::unique_ptr<blender::ui::AbstractTreeView> 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);

View File

@@ -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)
{