mirror of
https://github.com/golang/go
synced 2024-11-25 02:07:58 -07:00
godoc: use correct time stamp to indicate accuracy of search result
- compare against fsModified to check if index is out of date - don't change fsModified if there are no user-mapped file systems R=rsc, iant CC=golang-dev https://golang.org/cl/3213041
This commit is contained in:
parent
b84b20b820
commit
b1fd0860df
@ -186,11 +186,13 @@ func readDirList(filename string) ([]string, os.Error) {
|
||||
// is provided, it is used to filter directories.
|
||||
//
|
||||
func updateMappedDirs(filter func(string) bool) {
|
||||
fsMap.Iterate(func(path string, value *RWValue) bool {
|
||||
value.set(newDirectory(path, filter, -1))
|
||||
return true
|
||||
})
|
||||
invalidateIndex()
|
||||
if !fsMap.IsEmpty() {
|
||||
fsMap.Iterate(func(path string, value *RWValue) bool {
|
||||
value.set(newDirectory(path, filter, -1))
|
||||
return true
|
||||
})
|
||||
invalidateIndex()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1323,7 +1325,7 @@ func lookup(query string) (result SearchResult) {
|
||||
result.Query = query
|
||||
if index, timestamp := searchIndex.get(); index != nil {
|
||||
result.Hit, result.Alt, result.Illegal = index.(*Index).Lookup(query)
|
||||
_, ts := fsTree.get()
|
||||
_, ts := fsModified.get()
|
||||
result.Accurate = timestamp >= ts
|
||||
}
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user