// update modifies the priority of an item and updates the heap accordingly
325610
func (pq *priorityQueue) updatePriority(item *expiringBuffer, priority int64) {
	item.priority = priority
	// NOTE: fix is a slightly more efficient version of calling Remove() and
	// then Push()
	heap.Fix(pq, item.index)
}
659999
func (s *DB) Update(attrs ...interface{}) *DB {
	return s.Updates(toSearchableMap(attrs...), true)
}
450040
func (c *thresholdStateCache) Update(hash *chainhash.Hash, state ThresholdState) {
	c.entries[*hash] = state
}
587662
func (s *Snapshotter) Update(ctx context.Context, info snapshots.Info, fieldpaths ...string) (snapshots.Info, error) {
	log.G(ctx).Debugf("update: %s", strings.Join(fieldpaths, ", "))

	var err error
	err = s.withTransaction(ctx, true, func(ctx context.Context) error {
		info, err = storage.UpdateInfo(ctx, info, fieldpaths...)
		return err
	})

	return info, err
}
57519
func (p *Prque) Push(data interface{}, priority int64) {
	heap.Push(p.cont, &item{data, priority})
}
405086
func (s *strConf) Update(newValue []byte) error {
	s.mutex.Lock()
	defer s.mutex.Unlock()
	oldValue := s.currentVal.Load().(string)
	if newValue == nil {
		s.currentVal.Store(s.defaultVal)
	} else {
		s.currentVal.Store(string(newValue))
	}
	if oldValue != s.Get() {
		for _, w := range s.watches {
			w(&s.Str, oldValue)
		}
	}
	return nil
}
1196301
func (l *Lookups) Update() {
	l.m.Lock()
	defer l.m.Unlock()

	runtime.ReadMemStats(&l.mem)
	l.d.Update(int64(l.mem.Lookups))
}
874982
func (s *SourcesStore) Update(ctx context.Context, src chronograf.Source) error {
	return s.UpdateF(ctx, src)
}
361051
func (s *Layouts) Update(ctx context.Context, layout chronograf.Layout) error {
	var err error
	for _, store := range s.Stores {
		err = store.Update(ctx, layout)
		if err == nil {
			return nil
		}
	}
	return err
}
37877
func (m *MemoryManager) Update(policy Policy) error {
	m.Lock()
	defer m.Unlock()
	m.Policies[policy.GetID()] = policy
	return nil
}
252025
func (c *CompletionManager) Update(in Document) {
	c.tmp = c.completer(in)
	return
}
1003204
func (tm *taskManager) Update(ctx context.Context, task *api.Task) error {
	select {
	case tm.updateq <- task:
		return nil
	case <-tm.closed:
		return ErrClosed
	case <-ctx.Done():
		return ctx.Err()
	}
}
61944
func (g *StandardGaugeFloat64) Update(v float64) {
	g.mutex.Lock()
	defer g.mutex.Unlock()
	g.value = v
}
3561
func (tracker *VoteTracker) update(voteInfo *dcrjson.GetVoteInfoResult, blocks []int32,
	stakeInfo *dcrjson.GetStakeVersionInfoResult, stakeVersion uint32) {
	// Check if voteCounts are needed
	for idx := range voteInfo.Agendas {
		agenda := &voteInfo.Agendas[idx]
		if agenda.Status != statusDefined && agenda.Status != statusStarted {
			// check the cache
			counts := tracker.cachedCounts(agenda.ID)
			if counts == nil {
				counts = new(voteCount)
				var err error
				counts.yes, counts.abstain, counts.no, err = tracker.voteCounter(agenda.ID)
				if err != nil {
					log.Errorf("Error counting votes for %s: %v", agenda.ID, err)
					continue
				}
				tracker.cacheVoteCounts(agenda.ID, counts)
			}
			for idx := range agenda.Choices {
				choice := &agenda.Choices[idx]
				if choice.ID == choiceYes {
					choice.Count = counts.yes
				} else if choice.ID == choiceNo {
					choice.Count = counts.no
				} else {
					choice.Count = counts.abstain
				}
			}
		}
	}
	tracker.mtx.Lock()
	defer tracker.mtx.Unlock()
	tracker.voteInfo = voteInfo
	tracker.stakeInfo = stakeInfo
	ringLen := int(tracker.params.BlockUpgradeNumToCheck)
	for idx := range blocks {
		tracker.ringIndex = (tracker.ringIndex + 1) % ringLen
		tracker.blockRing[tracker.ringIndex] = blocks[idx]
	}
	tracker.blockVersion = tracker.blockRing[tracker.ringIndex]
	tracker.stakeVersion = stakeVersion
	tracker.ringHeight = voteInfo.CurrentHeight
	tracker.summary = tracker.newVoteSummary()
}
1298899
func (w *Window) Update() {
	mainthread.Call(func() {
		_, _, oldW, oldH := intBounds(w.bounds)
		newW, newH := w.window.GetSize()
		w.bounds = w.bounds.ResizedMin(w.bounds.Size().Add(pixel.V(
			float64(newW-oldW),
			float64(newH-oldH),
		)))
	})

	w.canvas.SetBounds(w.bounds)

	mainthread.Call(func() {
		w.begin()

		framebufferWidth, framebufferHeight := w.window.GetFramebufferSize()
		glhf.Bounds(0, 0, framebufferWidth, framebufferHeight)

		glhf.Clear(0, 0, 0, 0)
		w.canvas.gf.Frame().Begin()
		w.canvas.gf.Frame().Blit(
			nil,
			0, 0, w.canvas.Texture().Width(), w.canvas.Texture().Height(),
			0, 0, framebufferWidth, framebufferHeight,
		)
		w.canvas.gf.Frame().End()

		if w.vsync {
			glfw.SwapInterval(1)
		} else {
			glfw.SwapInterval(0)
		}
		w.window.SwapBuffers()
		w.end()
	})

	w.UpdateInput()
}
298882
func (w *weightedRandomSelect) update(item wrsItem) {
	w.setWeight(item, item.Weight())
}
979309
func (c *cpuCollector) Update(ch chan<- prometheus.Metric) error {
	if err := c.updateStat(ch); err != nil {
		return err
	}
	if err := c.updateThermalThrottle(ch); err != nil {
		return err
	}
	return nil
}