%Result = Its found right format for text for %pack ect

Code:
  if (%Result == Yes) { var %Loop = 1
    while ($strip($gettok(Latest),%Loop).data, 2-, 32) {
      if ($ifmatch == %Pack) { var %Latest = Yes | break }
      inc %Loop
    }
    if (!%Latest) {
      Hadd -m Latest $+(Pack-,$calc($hget(Latest,0).item + 1)) %Pack-Size %Pack | UnSet %Latest
      msg %TChan 15Added 11= $gettok($hget(-Latest,$+(Pack-,$hget(-Latest,0).item)), 2-, 32) 11=15 To !Latest
    }
  }


its working ok but when the hash log is big it can use alot of cpu im just wondering if theres a better way that dont use alot of cpu