From 199451f692dbe1389ac1f2d1407775586ea49a40 Mon Sep 17 00:00:00 2001 From: Ishan Jain Date: Sat, 2 Dec 2023 16:30:02 +0530 Subject: [PATCH] day2/1: optimized --- src/day2/1.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/day2/1.rs b/src/day2/1.rs index 629f382..d8171e1 100644 --- a/src/day2/1.rs +++ b/src/day2/1.rs @@ -25,18 +25,21 @@ fn process(data: &[u8]) -> u64 { line = &l[3..]; if num > 12 { possible = false; + break; } } [b'g', ..] => { line = &l[5..]; if num > 13 { possible = false; + break; } } [b'b', ..] => { line = &l[4..]; if num > 14 { possible = false; + break; } } [b' ', ..] => line = l,