You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Avoid useless computation of getMatchingRegexpAssociated that uses
Pattern (time consumming)
Goal :
Improve performance
See : https://pasteboard.co/7EJ61d3sSu5Y.png and
https://pasteboard.co/KvGgdDU7Macb.png
Why :
In ContentTypeMatcher for findContentTypeFor(String fileName) we take
the first result of currentCatalog.findContentTypesFor(this, fileName);
so if there is a result on selectMatchingByName(context, allByFileName,
Collections.emptySet(), fileName, IContentType.FILE_NAME_SPEC);
there is no need to compute selectMatchingByName(context,
allByFileExtension, selectedByName, fileExtension,
IContentType.FILE_EXTENSION_SPEC);
because it won't be used if there is no policy to reorder the results.
Copy file name to clipboardExpand all lines: runtime/bundles/org.eclipse.core.contenttype/src/org/eclipse/core/internal/content/ContentTypeCatalog.java
Copy file name to clipboardExpand all lines: runtime/bundles/org.eclipse.core.contenttype/src/org/eclipse/core/internal/content/ContentTypeMatcher.java
0 commit comments