Skip to content

Commit 943ab09

Browse files
authored
Clean up of some unused code (#5586)
1 parent 3e9026c commit 943ab09

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

src_cpp/py_connection.cpp

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,49 @@ static std::unordered_map<std::string, std::unique_ptr<Value>> transformPythonPa
294294
return result;
295295
}
296296

297+
template<typename T>
298+
bool integerFitsIn(int64_t val);
299+
300+
template<>
301+
bool integerFitsIn<int64_t>(int64_t) {
302+
return true;
303+
}
304+
305+
template<>
306+
bool integerFitsIn<int32_t>(int64_t val) {
307+
return val >= INT32_MIN && val <= INT32_MAX;
308+
}
309+
310+
template<>
311+
bool integerFitsIn<int16_t>(int64_t val) {
312+
return val >= INT16_MIN && val <= INT16_MAX;
313+
}
314+
315+
template<>
316+
bool integerFitsIn<int8_t>(int64_t val) {
317+
return val >= INT8_MIN && val <= INT8_MAX;
318+
}
319+
320+
template<>
321+
bool integerFitsIn<uint64_t>(int64_t val) {
322+
return val >= 0;
323+
}
324+
325+
template<>
326+
bool integerFitsIn<uint32_t>(int64_t val) {
327+
return val >= 0 && val <= UINT32_MAX;
328+
}
329+
330+
template<>
331+
bool integerFitsIn<uint16_t>(int64_t val) {
332+
return val >= 0 && val <= UINT16_MAX;
333+
}
334+
335+
template<>
336+
bool integerFitsIn<uint8_t>(int64_t val) {
337+
return val >= 0 && val <= UINT8_MAX;
338+
}
339+
297340
static LogicalType pyLogicalType(const py::handle& val) {
298341
auto datetime_datetime = importCache->datetime.datetime();
299342
auto time_delta = importCache->datetime.timedelta();

0 commit comments

Comments
 (0)