// Returns whether the underlying Buffer has any unsaved modifications.
// Note that Scratch buffers are never considered dirty.
971505
func (v *View) IsDirty() bool {
	if v.IsScratch() {
		return false
	}
	lastSave := v.Settings().Int("lime.last_save_change_count", -1)
	return v.ChangeCount() != lastSave
}
270041
func (c *Storage) UntrackCacheStorageForOrigin(origin string) (*gcdmessage.ChromeResponse, error) {
	var v StorageUntrackCacheStorageForOriginParams
	v.Origin = origin
	return c.UntrackCacheStorageForOriginWithParams(&v)
}
1138842
func isForked(s, head *big.Int) bool {
	if s == nil || head == nil {
		return false
	}
	return s.Cmp(head) <= 0
}
762865
func (s *Scratch) allocDtable() {
	tableSize := 1 << s.actualTableLog
	if cap(s.decTable) < int(tableSize) {
		s.decTable = make([]decSymbol, tableSize)
	}
	s.decTable = s.decTable[:tableSize]

	if cap(s.ct.tableSymbol) < 256 {
		s.ct.tableSymbol = make([]byte, 256)
	}
	s.ct.tableSymbol = s.ct.tableSymbol[:256]

	if cap(s.ct.stateTable) < 256 {
		s.ct.stateTable = make([]uint16, 256)
	}
	s.ct.stateTable = s.ct.stateTable[:256]
}
281450
func (ss *saveSet) ContainsRecursive(t *ast.Term, b *bindings) bool {
	found := false
	ast.WalkTerms(t, func(x *ast.Term) bool {
		if _, ok := x.Value.(ast.Var); ok {
			x1, b1 := b.apply(x)
			if x1 != x || b1 != b {
				if ss.ContainsRecursive(x1, b1) {
					found = true
				}
			} else if ss.Contains(x1, b1) {
				found = true
			}
		}
		return found
	})
	return found
}
820445
func (s *sessionV8) isModified(sessionFile string) (bool, *probe.Error) {
	qs, e := quick.NewConfig(s.Header, nil)
	if e != nil {
		return false, probe.NewError(e).Trace(s.SessionID)
	}

	var currentHeader = &sessionV8Header{}
	currentQS, e := quick.LoadConfig(sessionFile, nil, currentHeader)
	if e != nil {
		// If session does not exist for the first, return modified to
		// be true.
		if os.IsNotExist(e) {
			return true, nil
		}
		// For all other errors return.
		return false, probe.NewError(e).Trace(s.SessionID)
	}

	changedFields, e := qs.DeepDiff(currentQS)
	if e != nil {
		return false, probe.NewError(e).Trace(s.SessionID)
	}

	// Returns true if there are changed entries.
	return len(changedFields) > 0, nil
}
356331
func Compress1X(in []byte, s *Scratch) (out []byte, reUsed bool, err error) {
	s, err = s.prepare(in)
	if err != nil {
		return nil, false, err
	}
	return compress(in, s, s.compress1X)
}
38838
func IsModifiedAfter(fname string, fn func()) bool {
	fi1, err := os.Stat(fname)
	fn()
	fi2, _ := os.Stat(fname)

	return err == nil && !fi1.ModTime().Equal(fi2.ModTime())
}
32906
func (t *Term) Buffered() (int, error) {
	var n int
	err := termios.Tiocoutq(uintptr(t.fd), &n)
	return n, err
}
1208744
func IsEmpty(fV reflect.Value) bool {
	switch fV.Kind() {
	case reflect.Ptr, reflect.Interface:
		return fV.IsNil()
	case reflect.String:
		return fV.String() == ""
	case reflect.Array, reflect.Slice:
		return fV.Len() == 0
	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
		return fV.Int() == 0
	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
		return fV.Uint() == 0
	case reflect.Float32, reflect.Float64:
		return fV.Float() == 0
	}

	return false
}
1300141
func (s *CacheService) IsExpired(base string) bool {
	// No cache? bail.
	if cache[base] == nil || (len(cache[base].Rates) <= 0) {
		return true
	}

	// Expired cache? bail.
	lastUpdated := cache[base].UpdatedAt
	if lastUpdated != nil && lastUpdated.Add(cacheTTL).Before(time.Now()) {
		return true
	}

	return false
}
947325
func (l *SigChainLoader) CheckFreshness() (current bool, err error) {
	return l.chain.CheckFreshness(l.GetMerkleTriple())
}
1287389
func HasFsckCheck(ctx context.Context) bool {
	_, ok := ctx.Value(ctxKeyFsckCheck).(bool)
	return ok
}
848992
func (c cacheObjects) isCacheExclude(bucket, object string) bool {
	for _, pattern := range c.exclude {
		matchStr := fmt.Sprintf("%s/%s", bucket, object)
		if ok := wildcard.MatchSimple(pattern, matchStr); ok {
			return true
		}
	}
	return false
}
993099
func (b *BlockServerMemory) IsUnflushed(ctx context.Context, tlfID tlf.ID,
	_ kbfsblock.ID) (bool, error) {
	b.lock.RLock()
	defer b.lock.RUnlock()

	if b.m == nil {
		return false, errBlockServerMemoryShutdown
	}

	return false, nil
}
1088443
func (c DeclChecker) exprEqual(before, after ast.Expr) bool {
	if reflect.TypeOf(before) != reflect.TypeOf(after) {
		return false
	}

	switch before.(type) {
	case *ast.ChanType:
		change, _ := c.checkChan(before.(*ast.ChanType), after.(*ast.ChanType))
		return change.Change != Breaking
	case *ast.FuncType:
		change, _ := c.checkFunc(before.(*ast.FuncType), after.(*ast.FuncType))
		return change.Change != Breaking
	}

	// types.Identical returns false for any custom types when comparing
	// the results from two different type checkers. So, just compare by
	// name. Eg, func (_ CustomType) {}, CustomType is not identical, even
	// though comparing the type itself is. This applies to any non-built
	// in type, such as bytes.Buffer, *bytes.Buffer etc
	// https://play.golang.org/p/t6P5Uz6fIa
	//
	// Also compare types with types.TypeString to ignore any import aliases
	btype := c.binfo.TypeOf(before)
	atype := c.ainfo.TypeOf(after)
	if btype == nil || atype == nil {
		// Maybe nil when using exprInterfaceType which converts ast to string
		// and back to ast, without type checker knowing.
		return types.ExprString(before) == types.ExprString(after)
	}
	return types.TypeString(btype, nil) == types.TypeString(atype, nil)
}
1332342
func (c *cursor) skipPendingUpdates(forwards bool) {
	for c.dbIter.Valid() {
		var skip bool
		key := c.dbIter.Key()
		if c.bucket.tx.pendingRemove.Has(key) {
			skip = true
		} else if c.bucket.tx.pendingKeys.Has(key) {
			skip = true
		}
		if !skip {
			break
		}

		if forwards {
			c.dbIter.Next()
		} else {
			c.dbIter.Prev()
		}
	}
}