Revert accidental commit.

This commit is contained in:
Jeff Young 2018-08-08 12:42:15 +01:00
parent 8884298f29
commit 80f713f366
1 changed files with 16 additions and 22 deletions

View File

@ -707,34 +707,28 @@ long long TimestampDir( const wxString& aDirPath, const wxString& aFilespec )
{ {
long long timestamp = 0; long long timestamp = 0;
#if defined(__WIN32__) #ifdef __WINDOWS__
// Win32 version. // wxFileName construction is egregiously slow. Construct it once and just swap out
// Save time by not searching for each path twice: once in wxDir.GetNext() and once in // the filename thereafter.
// wxFileName.GetModificationTime(). Also cuts out wxWidgets string-matching and case WX_FILENAME fn( aDirPath, wxT( "dummyName" ) );
// conversion by staying on the MSW side of things. wxDir dir( aDirPath );
std::string filespec( aDirPath.t_str() ); wxString fullname;
filespec += '\\';
filespec += aFilespec.t_str();
WIN32_FIND_DATA findData; if( dir.IsOpened() )
wxDateTime lastModDate;
HANDLE fileHandle = ::FindFirstFile( filespec, &findData );
if( fileHandle != INVALID_HANDLE_VALUE )
{ {
do if( dir.GetFirst( &fullname, aFilespec ) )
{ {
ConvertFileTimeToWx( lastModDate, findData.ftLastWriteTime ); do
timestamp += lastModDate.GetValue().GetValue(); {
fn.SetFullName( fullname );
timestamp += fn.GetTimestamp();
}
while( dir.GetNext( &fullname ) );
} }
while ( FindNextFile( fileHandle, &findData ) != 0);
} }
FindClose( fileHandle );
#else #else
// POSIX version. // POSIX version. Save time by not converting between encodings -- do everything on
// Save time by not converting between encodings -- do everything on the file-system side. // the file-system side.
std::string filespec( aFilespec.fn_str() ); std::string filespec( aFilespec.fn_str() );
std::string dir_path( aDirPath.fn_str() ); std::string dir_path( aDirPath.fn_str() );