Skip to content
Browse files

Replace repeated calls to $obj.GdkWindow with $window, for slight tim…

…e savings.
  • Loading branch information...
1 parent 6e4bdd6 commit 3c71b6e568c1bc70bc0ffe4fed818a350d7be10f @colomon committed Nov 25, 2011
Showing with 4 additions and 3 deletions.
  1. +4 −3 bin/gtk-mandelbrot.pl
View
7 bin/gtk-mandelbrot.pl
@@ -263,7 +263,8 @@ ($obj, $args)
my $start-time = time;
my $windowX=0; my $windowY=0; my $windowWidth=0; my $windowHeight=0; my $windowDepth=0;
- $obj.GdkWindow.GetGeometry($windowX, $windowY, $windowWidth, $windowHeight, $windowDepth);
+ my $window = $obj.GdkWindow;
+ $window.GetGeometry($windowX, $windowY, $windowWidth, $windowHeight, $windowDepth);
my $delta-re = ($lower-left.re - $upper-right.re) / $windowWidth;
my $delta-im = ($upper-right.im - $lower-left.im) / $windowHeight;
@@ -278,12 +279,12 @@ ($obj, $args)
unless %colors{$value}:exists {
my $gc = GdkGC.new($obj.GdkWindow);
my $color = GdkColor.new(@red[$value], @green[$value], @blue[$value]);
- $obj.GdkWindow.Colormap.AllocColor($color, False, True);
+ $window.Colormap.AllocColor($color, False, True);
$gc.Foreground = $color;
%colors{$value} = $gc;
}
- $obj.GdkWindow.DrawPoint(%colors{$value}, $x, $y);
+ $window.DrawPoint(%colors{$value}, $x, $y);
$c += $delta-re;
}

0 comments on commit 3c71b6e

Please sign in to comment.
Something went wrong with that request. Please try again.