Skip to content

Commit 79fbf55

Browse files
Joseph-Edwardsjames-d-mitchell
authored andcommitted
Explain why we don't use from_int
1 parent 843b1d8 commit 79fbf55

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/transf.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ the image of the point ``i`` under the {0} is ``imgs[i]``.
112112
// work.
113113
try {
114114
auto result = a.at(b);
115+
// Don't use from_int here, because that will incorrectly convert
116+
// things to LIMIT_MAX and POSITIVE_INFINITY.
115117
if (result != UNDEFINED) {
116118
return {result};
117119
}
@@ -170,6 +172,9 @@ definition, which is equal to the size of :any:`{0}.images`.
170172
[](PTransfSubclass& self) {
171173
auto r = rx::iterator_range(self.begin(), self.end())
172174
| rx::transform(
175+
// Don't use from_int here, because that will
176+
// incorrectly convert things to LIMIT_MAX and
177+
// POSITIVE_INFINITY.
173178
[](auto val) -> int_or_unsigned_constant<Scalar> {
174179
if (val != UNDEFINED) {
175180
return {val};

0 commit comments

Comments
 (0)