diff --git a/src/relay/analysis/annotated_region_set.cc b/src/relay/analysis/annotated_region_set.cc index c70ef8ae242e1..94c7621e60afc 100644 --- a/src/relay/analysis/annotated_region_set.cc +++ b/src/relay/analysis/annotated_region_set.cc @@ -79,7 +79,7 @@ void AnnotatedRegionSetNode::AddToRegion(AnnotatedRegion dest, const Expr& expr) } } -AnnotatedRegion AnnotatedRegionSetNode::MakeRegion(std::string target) { +AnnotatedRegion AnnotatedRegionSetNode::MakeRegion(const std::string& target) { auto ret = regions_.emplace(AnnotatedRegion()); (*ret.first)->id_ = region_id_++; (*ret.first)->target_ = target; diff --git a/src/relay/analysis/annotated_region_set.h b/src/relay/analysis/annotated_region_set.h index cfd044e797760..3bd569387d461 100644 --- a/src/relay/analysis/annotated_region_set.h +++ b/src/relay/analysis/annotated_region_set.h @@ -197,7 +197,7 @@ class AnnotatedRegionSetNode : public Object { * * \return The new region. */ - AnnotatedRegion MakeRegion(std::string target); + AnnotatedRegion MakeRegion(const std::string& target); std::unordered_set regions_; /*! \brief The next region ID to assign. */