inliniac/suricata — pull request #1154 by ken-tilera (2014-10-07 14:36:46+00:00)
Title: Speed up SigMatchGetLastSMFromLists()

SigMatchGetLastSMFromLists() is finding the sm with the largest
index among all of the values returned from SigMatchGetLastSM() on
the set of (list and type) tuples passed as arguments.

The function was creating an array of the types, then creating an array
of the results of SigMatchGetLastSM(), sorting that list completely, then
only returning the first values from the list.

The new code, gets one set of arguments from the variable arguments, calls
SigMatchGetLastSM() and if the returned sm has a larger index, keeps that
as the last sm.

Passes prscript:
- PR build: https://buildbot.openinfosecfoundation.org/builders/ken-tilera/builds/17
- PR pcaps: https://buildbot.openinfosecfoundation.org/builders/ken-tilera-pcap/builds/16