about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--gifed/src/block/palette.rs2
-rw-r--r--gifed/src/lib.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/gifed/src/block/palette.rs b/gifed/src/block/palette.rs
index 534cfeb..9c4a5a9 100644
--- a/gifed/src/block/palette.rs
+++ b/gifed/src/block/palette.rs
@@ -42,7 +42,7 @@ impl Palette {
 	/// Returns the number of items that the decoder *thinks* is in the palette.
 	/// This is 2^(n + 1) where n = [Palette::packed_len]
 	pub fn computed_len(&self) -> usize {
-		2usize.pow(self.packed_len() as u32 + 1)
+		1 << (self.packed_len() + 1)
 	}
 
 	/// Pushes a color on to the end of the table
diff --git a/gifed/src/lib.rs b/gifed/src/lib.rs
index 966b46c..cfb124f 100644
--- a/gifed/src/lib.rs
+++ b/gifed/src/lib.rs
@@ -16,7 +16,7 @@ pub use lzw::LZW;
 /// Perform the algorithm to get the length of a color table from
 /// the value of the packed field. The max value here is 256
 pub(crate) fn packed_to_color_table_length(packed: u8) -> usize {
-	2usize.pow(packed as u32 + 1)
+	1 << (packed + 1)
 }
 
 //TODO: Be sure to check that fields in LSD and Img. Desc. that were reserved