Permalink
Browse files

Better toMatrix performance.

  • Loading branch information...
1 parent f67a355 commit c2656353791c12bb0fe74c84615e1aebc49de771 @meteficha meteficha committed Jan 17, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/Data/QRCode.hsc
View
@@ -138,5 +138,6 @@ toMatrix (QRcode _ width str) =
where
tobin c = c .&. 1
regroup [] = []
- regroup x = take width x : regroup (drop width x)
+ regroup xs = let ~(this, rest) = splitAt width xs
+ in this : regroup rest

0 comments on commit c265635

Please sign in to comment.