Skip to content
This repository has been archived by the owner on May 18, 2024. It is now read-only.

Commit

Permalink
refactor getPubName
Browse files Browse the repository at this point in the history
  • Loading branch information
xushiwei committed Jul 22, 2022
1 parent 478d52e commit 1c5ef51
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions cl/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,18 +461,17 @@ func (p *blockCtx) getPubName(pfnName *string) (ok bool) {
name := *pfnName
goName, ok := p.public[name]
if ok {
if goName != "" {
*pfnName = goName
} else {
*pfnName = cpackages.PubName(name)
if goName == "" {
goName = cpackages.PubName(name)
}
return
}
if _, ok = p.autopub[name]; ok {
} else if _, ok = p.autopub[name]; ok {
p.public[name] = ""
*pfnName = cpackages.PubName(name)
goName = cpackages.PubName(name)
} else {
return
}
return
*pfnName = goName
return goName != name
}

const (
Expand Down

0 comments on commit 1c5ef51

Please sign in to comment.