]> git.tuebingen.mpg.de Git - paraslash.git/commit
Speed up mood loading.
authorAndre Noll <maan@systemlinux.org>
Sat, 29 Sep 2007 11:13:50 +0000 (13:13 +0200)
committerAndre Noll <maan@systemlinux.org>
Sat, 29 Sep 2007 11:13:50 +0000 (13:13 +0200)
commit07010f70da6ea0ba9940116eef83abeb02fa8d5d
tree6a2d471b7b00e73868bee86d5e53429a1e011a59
parentec17f2a2552856bc5efa8e9dcdb0707b8c7e2694
Speed up mood loading.

The old code passed a pointer to the row of the audio file table to the
mood scoring functions. The scoring functions had to obtain the afsi,
afhi, path from that row pointer. Thus, at mood load time, the afsi,
afhi, path was extracted N times for each audio file if there are N
mood lines that used this info.

This patch changes the mood scoring functions so that they take
three pointers to afsi, afhi, path instead of the row pointer.
add_item_score(), the single caller of the mood scoring functions,
provides these pointers, i.e. they get extracted from the row pointer
only once per audio file.

This is still not optimal as most scoring functions use only one of
the three pointers. But let's not over-engineer the thing.
afs.h
aft.c
mood.c