View Issue Details

IDProjectCategoryView StatusLast Update
0003025MMW v4Properties/Auto-Toolspublic2007-05-16 14:45
Reporterjiri Assigned To 
PriorityurgentSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.0 
Summary0003025: Technical: Make SongTitleUsingMask() faster
Description1. Currently there are many choices made by using 'case' and 'if-else' statements. Instead, direct calling of methods should be used, i.e. something like:

procedure letterA;
begin
  if grouping then
    AddUnknownString( RemovePrefix(SD.Artist), num)
  else
    AddUnknownString( SD.Artist, num);
end;

procedure Empty;
begin
end;

//... other letters handled here

const procs : array [0..255] of procedure = {Empty, Empty, Empty, letterA {at position of ASCII 'A' letter}, .....};

and then in code something like:

procs[ord(UpCase(char(mask[i])))]

the syntax might need to be a little diffent, but the main idea should be clear.

2. IsCondTrue() doesn't support all new fields added (e.g. none of 'Z.' fields). This methods doesn't have to be implemented to be as fast as 1.

3. Quality (SD.Quality) field isn't present, should be added to all necessary places.
TagsNo tags attached.
Fixed in build

Activities

jiri

2007-05-03 08:53

administrator   ~0009098

Some remaining problems:
1. There's a very long initialization code (like procs[0] := Empty;), this should be an array of constants. For this reason procedures letterA(), ... would probably better be inside the main procedure, not class methods.
2. Two letter masks aren't handled the new way (like if (WideSameText (maskpattern, 'ZA') = True) then), they should be handled too - e.g. using letterZ procedure and a 'case' then.