Parcourir la Source

Do not limit bounds of numeric values before casting them

Ole Krüger il y a 10 ans
Parent
commit
d84b5cc1db
1 fichiers modifiés avec 1 ajouts et 7 suppressions
  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