馬老師GoLang后端工程師
2022-10-19 21:49 作者:三國(guó)盡歸許佳琪 | 我要投稿
}?else?if?((newCap?=?oldCap?<<?1)?<?MAXIMUM_CAPACITY?&&?? ? ? ? ? ? ? ? ? ?oldCap?>=?DEFAULT_INITIAL_CAPACITY)?? ? ? ? ? ? ? ?newThr?=?oldThr?<<?1;?// double threshold?? ? ? ?}?else?if?(oldThr?>?0)?// initial capacity was placed in threshold?? ? ? ? ? ?newCap?=?oldThr;?? ? ? ?else?{?? ? ? ? ? ? ??// zero initial threshold signifies using defaults?? ? ? ? ? ?newCap?=?DEFAULT_INITIAL_CAPACITY;?? ? ? ? ? ?newThr?=?(int)?(DEFAULT_LOAD_FACTOR?*?DEFAULT_INITIAL_CAPACITY);?? ? ???}?? ? ? ?if?(newThr?==?0)?{
標(biāo)簽: