Skip to content

Commit

Permalink
Remove unnecessary self variable check that breaks path processing
Browse files Browse the repository at this point in the history
  • Loading branch information
inangomfedorchenko committed Apr 7, 2022
1 parent 77e6944 commit f43a275
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions protoc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1164,26 +1164,22 @@ local function do_compile(self, f, ...)
end

function Parser:compile(s, name)
if self == Parser then self = Parser.new() end
local set = do_compile(self, self.parse, self, s, name)
return pb.encode('.google.protobuf.FileDescriptorSet', set)
end

function Parser:compilefile(fn)
if self == Parser then self = Parser.new() end
local set = do_compile(self, self.parsefile, self, fn)
return pb.encode('.google.protobuf.FileDescriptorSet', set)
end

function Parser:load(s, name)
if self == Parser then self = Parser.new() end
local ret, pos = pb.load(self:compile(s, name))
if ret then return ret, pos end
error("load failed at offset "..pos)
end

function Parser:loadfile(fn)
if self == Parser then self = Parser.new() end
local ret, pos = pb.load(self:compilefile(fn))
if ret then return ret, pos end
error("load failed at offset "..pos)
Expand Down

0 comments on commit f43a275

Please sign in to comment.