Ver código fonte

Do not limit bounds of numeric values before casting them

Ole Krüger 10 anos atrás
pai
commit
d84b5cc1db
1 arquivos alterados com 1 adições e 7 exclusões
  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