Opened 14 years ago

Last modified 14 years ago

#1474 closed Patch

Optimization for type parsing

Reported by: elsapo Owned by:
Priority: normal Component: Other
Keywords: Cc: elsapo, Tim Kosse
Component version: Operating system type:
Operating system version:

Description

In the transfer type parsing (guessing) code in
MainFrm.cpp circa line 2488 (in current CVS), the code
tries all types, even if it finds one. An optimization
would be to stop trying types when one is found.

Current code:

while ((i=AsciiFiles.Find( _T(";") ))!=-1)
{

if

("."+AsciiFiles.Left(i)==fn.Right(AsciiFiles.Left(i).GetLength()+1))

transferfile.nType=1;

AsciiFiles=AsciiFiles.Mid(i+1);

}

Code which stops trying guesses after it finds one:

while ((i=AsciiFiles.Find( _T(";") ))!=-1)
{

if

("."+AsciiFiles.Left(i)==fn.Right(AsciiFiles.Left(i).GetLength()+1))

{

transferfile.nType=1;
break;

}
AsciiFiles=AsciiFiles.Mid(i+1);

}

Change History (1)

comment:1 Changed 14 years ago by Tim Kosse

Thanks, your patch has been applied.

Note: See TracTickets for help on using tickets.