Commit 35da84bf authored by Joshua Haberman's avatar Joshua Haberman

Ported names fix for Ruby to the release branch.

parent 6d4e7fd7
...@@ -56,6 +56,7 @@ else ...@@ -56,6 +56,7 @@ else
module Internal module Internal
def self.infer_package(names) def self.infer_package(names)
# Package is longest common prefix ending in '.', if any. # Package is longest common prefix ending in '.', if any.
if not names.empty?
min, max = names.minmax min, max = names.minmax
last_common_dot = nil last_common_dot = nil
min.size.times { |i| min.size.times { |i|
...@@ -67,6 +68,9 @@ else ...@@ -67,6 +68,9 @@ else
end end
end end
nil
end
class NestingBuilder class NestingBuilder
def initialize(msg_names, enum_names) def initialize(msg_names, enum_names)
@to_pos = {nil=>nil} @to_pos = {nil=>nil}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment