Skip to content

Commit

Permalink
Initialize max values as large negative values. Reported by David Egts.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwhite committed Feb 6, 2012
1 parent 4892456 commit e0e6418
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ch02/src/main/python/max_temperature_reduce.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import sys

(last_key, max_val) = (None, 0)
(last_key, max_val) = (None, -sys.maxint)
for line in sys.stdin:
(key, val) = line.strip().split("\t")
if last_key and last_key != key:
Expand Down
2 changes: 1 addition & 1 deletion ch02/src/main/ruby/max_temperature_reduce.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env ruby

last_key, max_val = nil, 0
last_key, max_val = nil, -1000000
STDIN.each_line do |line|
key, val = line.split("\t")
if last_key && last_key != key
Expand Down

0 comments on commit e0e6418

Please sign in to comment.