hugolib: Unexport some internal methods

This commit is contained in:
Bjørn Erik Pedersen 2017-06-08 22:32:01 +02:00
parent b82cd82f11
commit 55dd533bf7
2 changed files with 7 additions and 7 deletions

View file

@ -313,7 +313,7 @@ func (ps Pages) String() string {
return fmt.Sprintf("Pages(%d)", len(ps)) return fmt.Sprintf("Pages(%d)", len(ps))
} }
func (ps Pages) FindPagePosByFilePath(inPath string) int { func (ps Pages) findPagePosByFilePath(inPath string) int {
for i, x := range ps { for i, x := range ps {
if x.Source.Path() == inPath { if x.Source.Path() == inPath {
return i return i
@ -322,7 +322,7 @@ func (ps Pages) FindPagePosByFilePath(inPath string) int {
return -1 return -1
} }
func (ps Pages) FindPagePosByFilePathPrefix(prefix string) int { func (ps Pages) findFirstPagePosByFilePathPrefix(prefix string) int {
if prefix == "" { if prefix == "" {
return -1 return -1
} }
@ -334,9 +334,9 @@ func (ps Pages) FindPagePosByFilePathPrefix(prefix string) int {
return -1 return -1
} }
// FindPagePos Given a page, it will find the position in Pages // findPagePos Given a page, it will find the position in Pages
// will return -1 if not found // will return -1 if not found
func (ps Pages) FindPagePos(page *Page) int { func (ps Pages) findPagePos(page *Page) int {
for i, x := range ps { for i, x := range ps {
if x.Source.Path() == page.Source.Path() { if x.Source.Path() == page.Source.Path() {
return i return i

View file

@ -141,7 +141,7 @@ func (c *PageCollections) addPage(page *Page) {
// so we need to remove all below a given path. // so we need to remove all below a given path.
func (c *PageCollections) removePageByPathPrefix(path string) { func (c *PageCollections) removePageByPathPrefix(path string) {
for { for {
i := c.rawAllPages.FindPagePosByFilePathPrefix(path) i := c.rawAllPages.findFirstPagePosByFilePathPrefix(path)
if i == -1 { if i == -1 {
break break
} }
@ -150,13 +150,13 @@ func (c *PageCollections) removePageByPathPrefix(path string) {
} }
func (c *PageCollections) removePageByPath(path string) { func (c *PageCollections) removePageByPath(path string) {
if i := c.rawAllPages.FindPagePosByFilePath(path); i >= 0 { if i := c.rawAllPages.findPagePosByFilePath(path); i >= 0 {
c.rawAllPages = append(c.rawAllPages[:i], c.rawAllPages[i+1:]...) c.rawAllPages = append(c.rawAllPages[:i], c.rawAllPages[i+1:]...)
} }
} }
func (c *PageCollections) removePage(page *Page) { func (c *PageCollections) removePage(page *Page) {
if i := c.rawAllPages.FindPagePos(page); i >= 0 { if i := c.rawAllPages.findPagePos(page); i >= 0 {
c.rawAllPages = append(c.rawAllPages[:i], c.rawAllPages[i+1:]...) c.rawAllPages = append(c.rawAllPages[:i], c.rawAllPages[i+1:]...)
} }
} }