File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -245,12 +245,15 @@ size_t MethodMeta::num_backends() const {
245245 return delegates ? delegates->size () : 0 ;
246246}
247247
248- const char * MethodMeta::get_backend_name (size_t index) const {
249- const auto delegates = s_plan_->delegates ();
250- if (delegates && index < delegates->size ()) {
251- return delegates->Get (index)->id ()->c_str ();
252- }
253- return nullptr ;
248+ Result<const char *> MethodMeta::get_backend_name (size_t index) const {
249+ const auto count = num_backends ();
250+ ET_CHECK_OR_RETURN_ERROR (
251+ index < count,
252+ InvalidArgument,
253+ " Index %zu out of range. num_backends: %zu" ,
254+ index,
255+ count);
256+ return s_plan_->delegates ()->Get (index)->id ()->c_str ();
254257}
255258
256259size_t MethodMeta::num_instructions () const {
You can’t perform that action at this time.
0 commit comments