// Returns true if things[i] should precede things[j], which is true if it is a
// younger redditThing (more recent creation time).
321947
func (b byCreationTime) Less(i, j int) bool {
	return b.things[i].Birth() > b.things[j].Birth()
}
737072
func (item *Item) PreviewComments() []Comment {
	switch s := item.Previewcomments.(type) {
	case []interface{}:
		if len(s) == 0 {
			return nil
		}

		switch s[0].(type) {
		case interface{}:
			comments := make([]Comment, 0)
			for i := range s {
				if buf, err := json.Marshal(s[i]); err != nil {
					return nil
				} else {
					comment := &Comment{}

					if err = json.Unmarshal(buf, comment); err != nil {
						return nil
					} else {
						comments = append(comments, *comment)
					}
				}
			}
			return comments
		case string:
			comments := make([]Comment, 0)
			for i := range s {
				comments = append(comments, Comment{
					Text: s[i].(string),
				})
			}
			return comments
		}
	case string:
		comments := []Comment{
			{
				Text: s,
			},
		}
		return comments
	}
	return nil
}
574132
func (history *History) Less(i, j int) bool {
	sandboxes := *history
	// FIXME: state access should be serialized
	return sandboxes[j].createdAt.Before(sandboxes[i].createdAt)
}
1094963
func (l *StringLiteral) IsTimeLiteral() bool {
	return isDateTimeString(l.Val) || isDateString(l.Val)
}
720942
func (p *parser) consumeParenthesis() bool {
	if p.i < len(p.s) && p.s[p.i] == '(' {
		p.i++
		p.skipWhitespace()
		return true
	}
	return false
}
1326935
func (p *parser) parsePredicate(n node) node {
	p.skipItem(itemLBracket)
	opnd := p.parseExpression(n)
	p.skipItem(itemRBracket)
	return opnd
}
245742
func (its itemSlice) Less(i, j int) bool {
	mI, mJ := its[i].Metadata(), its[j].Metadata()
	if mI != nil && mJ != nil {
		if mI.CTime().Equal(mJ.CTime()) {
			if mI.MsgID() != nil && mJ.MsgID() != nil {
				return bytes.Compare(mI.MsgID().Bytes(), mJ.MsgID().Bytes()) < 0
			} else {
				return mI.MsgID() == nil
			}
		}
		return mI.CTime().Before(mJ.CTime())
	}
	return mI == nil
}
195532
func (c *BundlingChecker) check(items []checkerItem) {
	c.waitc <- struct{}{}
	c.wg.Add(1)
	go func() {
		c.doCheck(items)
		c.wg.Done()
		<-c.waitc
	}()

}
596129
func (s timeSorter) Less(i, j int) bool {
	return s[i] < s[j]
}
923939
func (xmlNode *XmlNode) PreviousSibling() Node {
	siblingPtr := (*C.xmlNode)(xmlNode.Ptr.prev)
	return NewNode(unsafe.Pointer(siblingPtr), xmlNode.Document)
}
801417
func (l *loki) shouldBreakThings() bool {
	l.Lock()
	defer l.Unlock()
	l.callcount++
	if l.callcount > 15 {
		l.callcount = 0
		return false
	}
	if l.callcount > 10 {
		return true
	}

	return false
}
211922
func (s *ShapeIndexIterator) Prev() bool {
	if s.position <= 0 {
		return false
	}

	s.position--
	s.refresh()
	return true
}
638493
func (z *Big) CheckNaNs(x, y *Big) bool {
	return z.invalidContext(z.Context) || z.checkNaNs(x, y, 0)
}
1218588
func (c ColumnElem) DoesNotEqual(i interface{}) BinaryClause {
	return BinaryClause{
		Pre:  c,
		Post: &Parameter{i},
		Sep:  " != ",
	}
}
1134759
func isComment(b []rune) bool {
	if len(b) == 0 {
		return false
	}

	switch b[0] {
	case ';':
		return true
	case '#':
		return true
	}

	return false
}
335064
func (v *Version) MinorNewer(o *Version) bool {
	if v.Major != o.Major {
		return v.Major > o.Major
	}
	if v.Minor != o.Minor {
		return v.Minor > o.Minor
	}
	return false
}
571794
func Intersect(its ...Postings) Postings {
	if len(its) == 0 {
		return EmptyPostings()
	}
	if len(its) == 1 {
		return its[0]
	}

	l := len(its) / 2
	a := Intersect(its[:l]...)
	b := Intersect(its[l:]...)

	if a == EmptyPostings() || b == EmptyPostings() {
		return EmptyPostings()
	}
	return newIntersectPostings(a, b)
}