lebron374 commented on issue #2082:
URL: https://github.com/apache/rocketmq/issues/2082#issuecomment-642974822
> > > I have seen the source code
> > > **NamespaceUtil#wrapNamespace**
> > > ```java
> > > public static String wrapNamespace(String namespace, String
resourceWithOutNamespace) {
> > > // ...
> > > StringBuffer strBuffer = new StringBuffer();
> > >
> > > if (isRetryTopic(resourceWithOutNamespace)) {
> > > strBuffer.append(MixAll.RETRY_GROUP_TOPIC_PREFIX);
> > > }
> > >
> > > if (isDLQTopic(resourceWithOutNamespace)) {
> > > strBuffer.append(MixAll.DLQ_GROUP_TOPIC_PREFIX);
> > > }
> > >
> > > return
strBuffer.append(namespace).append(NAMESPACE_SEPARATOR).append(resourceWithoutRetryAndDLQ).toString();
> > >
> > > }
> > > ```
> > >
> > >
> > > Maybe use `StringBuilder` is better because I think it is local
variable level and obj doesn't "escape" from this method.
> > > Feel free to reply for studying, thanks.
> >
> >
> > yep, StringBuilder performs better in this case.
>
> i can create a new pr to solve this problem.
good job
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]