Skip to content

Commit 3251e70

Browse files
author
BoboTiG
committed
MSSwindows: few optimizations into _arrange()
1 parent 144ac0e commit 3251e70

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

mss.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
- few optimizations into MSSLinux::get_pixels()
2929
- few optimizations into MSSImage::png()
3030
0.0.4 - MSSLinux: use of memoization => huge time/operations gains
31+
0.0.5 - few optimizations into MSSWindows: _arrange()
3132
3233
You can always get the latest version of this module at:
3334
@@ -39,7 +40,7 @@
3940
from __future__ import (unicode_literals, absolute_import,
4041
division, print_function)
4142

42-
__version__ = '0.0.4'
43+
__version__ = '0.0.5'
4344
__author__ = "Mickaël 'Tiger-222' Schoentgen"
4445
__copyright__ = '''
4546
Copyright (c) 2013, Mickaël 'Tiger-222' Schoentgen
@@ -697,10 +698,8 @@ def _arrange(self, data, width, height):
697698
for y in range(height):
698699
off = width * (y + 1)
699700
offset = total - off
700-
x = 0
701-
while x < width - 2:
701+
for x in range(0, width - 2, 3):
702702
scanlines[off+x:off+x+3] = b(data[offset+x+2]), b(data[offset+x+1]), b(data[offset+x])
703-
x += 3
704703
return b''.join(scanlines)
705704

706705

0 commit comments

Comments
 (0)