CnPack Forum


 
wuyou
新警察
Rank: 1



UID 10433
Digest Posts 0
Credits 11
Posts 4
点点分 11
Reading Access 10
Registered 2007-4-12
Status Offline
Post at 2018-11-6 11:03  Profile | Blog | P.M. 
HashMap 建议

建议将 FList: array of TCnHashMapRec;
移到 protected
使得继承的类可以输出 FList 列表,不需要每次都跑 GetNext,这不是线程安全的

TWgs = array of TWg;

function TWgMap.GetList: TWgs;
var
  i,j: Integer;
begin
  SetLength(Result, Size);
  j := 0;

  for I := Low(FList) to High(FList) do begin
    if FList.HashCode < 0 then Continue;

    Result[j] := PWg(Pointer(Integer(FList.Value)))^;
    inc(j);
  end;
end;

[ 本帖最后由 wuyou 于 2018-11-6 11:20 编辑 ]
Top
Passion (LiuXiao)
管理员
Rank: 9Rank: 9Rank: 9


UID 359
Digest Posts 19
Credits 6838
Posts 3591
点点分 6838
Reading Access 102
Registered 2004-3-28
Status Offline
Post at 2018-11-6 22:45  Profile | Blog | P.M. 
您的建议有道理,我们已将FList移动至protected节,git上的cnvcl代码已更新。
Top
 




All times are GMT++8, the time now is 2024-11-21 21:06

    本论坛支付平台由支付宝提供
携手打造安全诚信的交易社区 Powered by Discuz! 5.0.0  © 2001-2006 Comsenz Inc.
Processed in 0.007645 second(s), 7 queries , Gzip enabled

Clear Cookies - Contact Us - CnPack Website - Archiver - WAP