Skip to content

Commit 69f5a28

Browse files
committed
Remove duplicated code
1 parent a479de3 commit 69f5a28

File tree

3 files changed

+2
-7
lines changed

3 files changed

+2
-7
lines changed

_tools/go-inline

+2-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ for file in sorted(files, reverse=True):
2323
line = contents[i]
2424
m = re.match(".*\/\/ \+inline-start", line)
2525
if m:
26-
# func (ls *LState) pushCallFrame(cf callFrame, fn LValue, meta bool) {
2726
m2 = re.match("^func\s*(\([\*\s\w]+\))?\s*(\w+)\(([^\)]*)\)", line)
2827
name = m2.group(2)
2928
tinline = inline(name)
@@ -51,7 +50,7 @@ def do_inlining(text):
5150
if m:
5251
inlinet = inlines[m.group(1).split(".")[-1]]
5352
buf.append("// this section is inlined by go-inline")
54-
buf.append("// source function 'is' {} in {}".format(inlinet.original, inlinet.file))
53+
buf.append("// source function is '{}' in '{}'".format(inlinet.original, inlinet.file))
5554
buf.append("{")
5655
if len(inlinet.receiver) > 0 and inlinet.receiver != m.group(1).split(".")[0]:
5756
buf.append("{} := {}".format(inlinet.receiver, ".".join(m.group(1).split(".")[0:-1])))
@@ -72,6 +71,6 @@ for file in files:
7271
continue
7372
contents = open(file).read()
7473
with open(file.lstrip("_"), "w") as io:
75-
io.write("// This file was generated by go-inline.DO NOT EDIT.\n")
74+
io.write("// This file was generated by go-inline. DO NOT EDIT.\n")
7675
io.write(do_inlining(contents))
7776
io.write("\n")

_vm.go

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ func mainLoop(L *LState, baseframe *callFrame) {
3232

3333
func copyReturnValues(L *LState, regv, start, n, b int) { // +inline-start
3434
if b == 1 {
35-
L.reg.FillNil(regv, n)
3635
// +inline-call L.reg.FillNil regv n
3736
} else {
3837
// +inline-call L.reg.CopyRange regv start -1 n

vm.go

-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ func mainLoop(L *LState, baseframe *callFrame) {
3333

3434
func copyReturnValues(L *LState, regv, start, n, b int) { // +inline-start
3535
if b == 1 {
36-
L.reg.FillNil(regv, n)
3736
// this section is inlined by go-inline
3837
// source function 'is' func (rg *registry) FillNil(regm, n int) in _state.go
3938
{
@@ -810,7 +809,6 @@ func init() {
810809
start := RA
811810
b := B
812811
if b == 1 {
813-
L.reg.FillNil(regv, n)
814812
// this section is inlined by go-inline
815813
// source function 'is' func (rg *registry) FillNil(regm, n int) in _state.go
816814
{
@@ -849,7 +847,6 @@ func init() {
849847
start := RA
850848
b := B
851849
if b == 1 {
852-
L.reg.FillNil(regv, n)
853850
// this section is inlined by go-inline
854851
// source function 'is' func (rg *registry) FillNil(regm, n int) in _state.go
855852
{

0 commit comments

Comments
 (0)