Skip to content

Instantly share code, notes, and snippets.

View cwillu's full-sized avatar

Carey Underwood cwillu

View GitHub Profile
if view.get_insert_spaces_instead_of_tabs():
tabsize = view.get_tab_width()
spaces = " " * tabsize
after = after.replace("\t",spaces)
void
Drawing::_pickItemsForCaching()
{
// we cache the objects with the highest score until the budget is exhausted
_candidate_items.sort(std::greater<CacheRecord>());
size_t used = 0;
CandidateList::iterator i;
for (i = _candidate_items.begin(); i != _candidate_items.end(); ++i) {
if (used + i->cache_size > _cache_budget) break;
used += i->cache_size;