JarvisCraft opened a new pull request, #12343:
URL: https://github.com/apache/lucene/pull/12343

   ### Description
   
   Currently constructors of `Term` require the internal `BytesRef` to be 
unmodifiable from the outside
   and thus perform defensive copying in order to uphold this invariant.
   In order to omit redundant copying there are constructor overloads which 
accept
   `BytesRefBuilder` and `String` to create new `BytesRef`s from them.
   The latter delegates to `BytesRef(CharSequence)` constructor internally.
   
   Current approach does not however allow the creation of `Term`s from 
`CharSequence`s
   which is a valid use-case (e.g. when creating `Term`s from 
`CharTermAttribute`s)
   thus an overload delegating to `BytesRef(CharSequence)` is added in order to 
support such use-cases.
   The previous `Term(String fld, String text)` constructor is preserved to 
maintain binary compatibility
   and possibly allow futher `String`-specific optimizations.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to