lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Namgyu Kim (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (LUCENE-8449) Code Optimizations in FieldTermStack
Date Thu, 09 Aug 2018 17:00:00 GMT

     [ https://issues.apache.org/jira/browse/LUCENE-8449?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Namgyu Kim updated LUCENE-8449:
-------------------------------
    Description: 
-1) "vector.hasPositions() == false" in FieldTermStack's constructor-

-can be changed to "*!vector.hasPositions()*"-

 

2) "public TermInfo(String, int, int, int, float)" constructor

can be change to "*TermInfo(String, int, int, int, float)*"

 

3) TermInfo's toString method
{code:java}
public String toString() {
	StringBuilder sb = new StringBuilder();
	sb.append( text ).append( '(' ).append(startOffset).append	( ',' ).append( endOffset ).append(
',' ).append( position ).append( ')' );
	return sb.toString();
}{code}
This code can be changed to

 
{code:java}
public String toString(){
  return text + '(' + startOffset + ',' + endOffset + ',' + position + ')';
}
{code}
this code.

 

 

4) TermInfo's equals method
{code:java}
public boolean equals(Object obj) {
	...
	if (position != other.position) {
        	return false;
	}
	return true;
}
{code}
This code can be changed to

 
{code:java}
public boolean equals(Object obj) {
	...
	return position == other.position;
}
{code}

  was:
1) "vector.hasPositions() == false" in FieldTermStack's constructor

can be changed to "*!vector.hasPositions()*"

 

2) "public TermInfo(String, int, int, int, float)" constructor

can be change to "*TermInfo(String, int, int, int, float)*"

 

3) TermInfo's toString method
{code:java}
public String toString() {
	StringBuilder sb = new StringBuilder();
	sb.append( text ).append( '(' ).append(startOffset).append	( ',' ).append( endOffset ).append(
',' ).append( position ).append( ')' );
	return sb.toString();
}{code}
This code can be changed to

 
{code:java}
public String toString(){
  return text + '(' + startOffset + ',' + endOffset + ',' + position + ')';
}
{code}
this code.

 

 

4) TermInfo's equals method
{code:java}
public boolean equals(Object obj) {
	...
	if (position != other.position) {
        	return false;
	}
	return true;
}
{code}
This code can be changed to

 
{code:java}
public boolean equals(Object obj) {
	...
	return position == other.position;
}
{code}


> Code Optimizations in FieldTermStack
> ------------------------------------
>
>                 Key: LUCENE-8449
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8449
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: modules/highlighter
>            Reporter: Namgyu Kim
>            Priority: Minor
>              Labels: newbie, performance
>         Attachments: LUCENE-8449.patch
>
>
> -1) "vector.hasPositions() == false" in FieldTermStack's constructor-
> -can be changed to "*!vector.hasPositions()*"-
>  
> 2) "public TermInfo(String, int, int, int, float)" constructor
> can be change to "*TermInfo(String, int, int, int, float)*"
>  
> 3) TermInfo's toString method
> {code:java}
> public String toString() {
> 	StringBuilder sb = new StringBuilder();
> 	sb.append( text ).append( '(' ).append(startOffset).append	( ',' ).append( endOffset
).append( ',' ).append( position ).append( ')' );
> 	return sb.toString();
> }{code}
> This code can be changed to
>  
> {code:java}
> public String toString(){
>   return text + '(' + startOffset + ',' + endOffset + ',' + position + ')';
> }
> {code}
> this code.
>  
>  
> 4) TermInfo's equals method
> {code:java}
> public boolean equals(Object obj) {
> 	...
> 	if (position != other.position) {
>         	return false;
> 	}
> 	return true;
> }
> {code}
> This code can be changed to
>  
> {code:java}
> public boolean equals(Object obj) {
> 	...
> 	return position == other.position;
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message