cyotek / imagelistview

Automatically exported from code.google.com/p/imagelistview
5 stars 0 forks source link

Improve speed for ImageListViewCacheMetadata.FromFile() #113

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Having a project where I (intentionally) am adding multiple non-existing paths 
to the list view, I get a (caught) exception in

public static ImageMetadata ImageListViewCacheMetadata.FromFile(string path, 
bool useWIC)

Since exceptions have a rather bad performance, I suggest to add one single 
check:

...
FileInfo info = new FileInfo(path);
if( !info.Exists ) { return imageInfo; } // <-- Add this line.
...

This would improve my program performance significantly.

Original issue reported on code.google.com by uwe.k...@gmail.com on 12 Nov 2010 at 12:57

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r563.

Original comment by oozcitak on 12 Nov 2010 at 1:08

GoogleCodeExporter commented 9 years ago
Wow, this was quick. Thank you very much!

Original comment by uwe.k...@gmail.com on 12 Nov 2010 at 1:13