less garbage during indexing (-30M for IDEA project), just in case each TokenSet is 5K each

This commit is contained in:
Maxim.Mossienko
2012-05-02 21:31:04 +04:00
parent cca8b51961
commit 0f38219efb
3 changed files with 10 additions and 2 deletions
@@ -17,12 +17,14 @@ package com.intellij.lexer;
import com.intellij.psi.JavaDocTokenType;
import com.intellij.psi.tree.IElementType;
import com.intellij.psi.tree.TokenSet;
/**
* @author yole
*/
public class JavaDocTokenTypes implements DocCommentTokenTypes {
public static final DocCommentTokenTypes INSTANCE = new JavaDocTokenTypes();
private final TokenSet mySpaceCommentsSet = TokenSet.create(JavaDocTokenType.DOC_SPACE, JavaDocTokenType.DOC_COMMENT_DATA);
private JavaDocTokenTypes() { }
@@ -41,6 +43,11 @@ public class JavaDocTokenTypes implements DocCommentTokenTypes {
return JavaDocTokenType.DOC_COMMENT_DATA;
}
@Override
public TokenSet spaceCommentsTokenSet() {
return mySpaceCommentsSet;
}
@Override
public IElementType space() {
return JavaDocTokenType.DOC_SPACE;