need to optimize search block

In my iRule, i have below block. Can someone please optimize this code. My concern is that “static::payld” may store few 100 URLs, and iterating over these URLs will impact the performance.

foreach pl_uri $static::payld {

if { ([HTTP::uri] starts_with $pl_uri) and not( $pl_uri equals “” ) } {

log local0. “Redirect: For [HTTP::uri] matched $pl_uri”

set redirect 1

break

}

}

Found out that we can use matchclass method on lists too… pretty cool. above code is replaced as

set static::payld [lreplace $static::payld [lsearch -exact $static::payld “”] [lsearch -exact $static::payld “”]]

if { [matchclass [HTTP::uri] starts_with $static::payld] } {

HTTP::respond 302 Location $kill_switch_url

}

here is the reference [comment 1]

http://devcentral.f5.com/Tutorials/TechTips/tabid/63/articleType/ArticleView/articleId/138/iRules-101\-\-08\-\-Classes.aspx