:48.808KB : :1 :2019-12-28 06:15:30
核心代码参考来源于易语言源码网,可惜现在不能下载任何代码了,调用了大神的哈希表模块。
hHeap = _PtrGet (hHashTable, #ht_hHeap)
oldCapacity = _PtrGet (hHashTable, #ht_tableLenth) ' ht.tableLenth
oldTable = _PtrGet (hHashTable, #ht_table) ' ht.table
newCapacity = oldCapacity × 2 + 1
newTable = HeapAlloc (hHeap, #HEAP_ZERO_MEMORY, newCapacity × 4)
_inc (hHashTable + #ht_modCount) ' ht.modCount = ht.modCount + 1 更新修改统计数
_PtrSet (hHashTable, #ht_threshold, newCapacity × _指针到小数 (hHashTable + 20)) ' ht.threshold = newCapacity × ht.loadFactor
_PtrSet (hHashTable, #ht_table, newTable) ' ht.table = newTable
_PtrSet (hHashTable, #ht_tableLenth, newCapacity) ' ht.tableLenth = newCapacity
.计次循环首 (oldCapacity, i)
oldpe = _指针到整数 (oldTable + (i - 1) × 4)
.判断循环首 (oldpe ≠ 0)
newpe = HeapAlloc (hHeap, #HEAP_ZERO_MEMORY, #e_size)
RtlMoveMemory (newpe, oldpe, #e_size)
oldpe = _PtrGet (newpe, #e_next) ' e.next
index = 位与 (_PtrGet (newpe, #e_hashCode), 2147483647) % newCapacity ' 计算新的索引
' 插入到新的链表中
_PtrSet (newpe, #e_next, _指针到整数 (newTable + index × 4)) ' e.next = newtable[index]
_PtrSet (newTable, index × 4, newpe) ' newtable[index] = e
.判断循环尾 ()
.计次循环尾 ()
HeapFree (hHeap, 0, oldTable)
02-17会员管理插件源码
02-16动态创建菜单与响应事件源码,菜单编辑器
02-09画板快捷启动3.2源码修改版
02-09王者荣耀战力小程序源码分享
02-09简单的指定颜色抠图源码
02-05WinLicense授权SDK源码
02-05文本逐字分割源码及优化历程
02-05易语言调用cmd命令并编辑框显示执行结果
09-07C++的string的实现源码分析
10-15易语言word循环插入文字 图片工具源码