Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
39b6fb7a
Commit
39b6fb7a
authored
Oct 07, 2011
by
Robert Griesemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
go/token: remove obsolete comment (cleanup)
R=r CC=golang-dev
https://golang.org/cl/5235042
parent
b5260364
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
position.go
src/pkg/go/token/position.go
+2
-4
No files found.
src/pkg/go/token/position.go
View file @
39b6fb7a
...
@@ -86,9 +86,11 @@ func searchFiles(a []*File, x int) int {
...
@@ -86,9 +86,11 @@ func searchFiles(a []*File, x int) int {
}
}
func
(
s
*
FileSet
)
file
(
p
Pos
)
*
File
{
func
(
s
*
FileSet
)
file
(
p
Pos
)
*
File
{
// common case: p is in last file touched
if
f
:=
s
.
last
;
f
!=
nil
&&
f
.
base
<=
int
(
p
)
&&
int
(
p
)
<=
f
.
base
+
f
.
size
{
if
f
:=
s
.
last
;
f
!=
nil
&&
f
.
base
<=
int
(
p
)
&&
int
(
p
)
<=
f
.
base
+
f
.
size
{
return
f
return
f
}
}
// p is not in last file touched - search all files
if
i
:=
searchFiles
(
s
.
files
,
int
(
p
));
i
>=
0
{
if
i
:=
searchFiles
(
s
.
files
,
int
(
p
));
i
>=
0
{
f
:=
s
.
files
[
i
]
f
:=
s
.
files
[
i
]
// f.base <= int(p) by definition of searchFiles
// f.base <= int(p) by definition of searchFiles
...
@@ -123,10 +125,6 @@ func (f *File) position(p Pos) (pos Position) {
...
@@ -123,10 +125,6 @@ func (f *File) position(p Pos) (pos Position) {
// Position converts a Pos in the fileset into a general Position.
// Position converts a Pos in the fileset into a general Position.
func
(
s
*
FileSet
)
Position
(
p
Pos
)
(
pos
Position
)
{
func
(
s
*
FileSet
)
Position
(
p
Pos
)
(
pos
Position
)
{
if
p
!=
NoPos
{
if
p
!=
NoPos
{
// TODO(gri) consider optimizing the case where p
// is in the last file added, or perhaps
// looked at - will eliminate one level
// of search
s
.
mutex
.
RLock
()
s
.
mutex
.
RLock
()
if
f
:=
s
.
file
(
p
);
f
!=
nil
{
if
f
:=
s
.
file
(
p
);
f
!=
nil
{
pos
=
f
.
position
(
p
)
pos
=
f
.
position
(
p
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment