Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initialize max values as large negative values. Reported by David Egts.

  • Loading branch information...
commit e0e64180bf5ede5353e4c78d85331bc56fc47e22 1 parent 4892456
@tomwhite authored
View
2  ch02/src/main/python/max_temperature_reduce.py
@@ -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:
View
2  ch02/src/main/ruby/max_temperature_reduce.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.