Просмотр исходного кода

Do not limit bounds of numeric values before casting them

Ole Krüger лет назад: 10
Родитель
Сommit
d84b5cc1db
1 измененных файлов с 1 добавлено и 7 удалено
  1. 1 7
      lib/luwra/types.hpp

+ 1 - 7
lib/luwra/types.hpp

@@ -142,13 +142,7 @@ namespace internal {
 		static inline
 		I read(State* state, int index) {
 			return
-				std::max<B>(
-					std::numeric_limits<I>::lowest(),
-					std::min<B>(
-						std::numeric_limits<I>::max(),
-						NumericTransportValue<B>::read(state, index)
-					)
-				);
+				static_cast<I>(NumericTransportValue<B>::read(state, index));
 		}
 
 		static inline