Skip to content

Commit 843b1d8

Browse files
fixup
1 parent aa38f10 commit 843b1d8

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/transf.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,11 @@ the image of the point ``i`` under the {0} is ``imgs[i]``.
111111
// corresponds to a std::out_of_range for things like list(a) to
112112
// work.
113113
try {
114-
return from_int(a.at(b));
114+
auto result = a.at(b);
115+
if (result != UNDEFINED) {
116+
return {result};
117+
}
118+
return {UNDEFINED};
115119
} catch (LibsemigroupsException const& e) {
116120
throw std::out_of_range(formatted_error_message(e));
117121
}
@@ -167,7 +171,10 @@ definition, which is equal to the size of :any:`{0}.images`.
167171
auto r = rx::iterator_range(self.begin(), self.end())
168172
| rx::transform(
169173
[](auto val) -> int_or_unsigned_constant<Scalar> {
170-
return from_int(val);
174+
if (val != UNDEFINED) {
175+
return {val};
176+
}
177+
return {UNDEFINED};
171178
});
172179
return py::make_iterator(rx::begin(r), rx::end(r));
173180
},

0 commit comments

Comments
 (0)