From 59fc6b961b9c798e1fd107a689bd716e17f7f948 Mon Sep 17 00:00:00 2001 From: Joseph Montanaro Date: Mon, 22 Mar 2021 17:23:28 -0700 Subject: [PATCH] eliminate unnecessary indirection in ColorStack iterator --- .gitignore | 3 ++- colors.nim | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index adb36c8..4d8d0fc 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -*.exe \ No newline at end of file +*.exe +profile_results.txt \ No newline at end of file diff --git a/colors.nim b/colors.nim index e22b286..681142b 100644 --- a/colors.nim +++ b/colors.nim @@ -60,7 +60,7 @@ proc len*(s: ColorStack): int8 = iterator items*(s: ColorStack): Color = for i in 0 .. s.last: - yield Color(s[i]) + yield Color(s.pieces[i]) iterator asInt*(s: ColorStack): int8 =