https://github.com/apache/incubator-dubbo/blob/3e9b66854c6f70b1dfa7dd19e689bd04ae0ecb41/dubbo-registry/dubbo-registry-redis/src/main/java/com/alibaba/dubbo/registry/redis/RedisRegistry.java#L590

https://github.com/apache/incubator-dubbo/blob/3e9b66854c6f70b1dfa7dd19e689bd04ae0ecb41/dubbo-registry/dubbo-registry-redis/src/main/java/com/alibaba/dubbo/registry/redis/RedisRegistry.java#L602

Just read the RedisRegistry.java and got doubtful about the above lines. Is the following code more appropriate ?

```
if (first) {
   // blah blah												
} 
```



if (categoryPath.startsWith(root)) {
            i = categoryPath.indexOf(Constants.PATH_SEPARATOR, root.length());
        } else {
            i = categoryPath.indexOf(Constants.PATH_SEPARATOR);
        }
        return i > 0 ? categoryPath.substring(0, i) : categoryPath;
    }
    private String toServicePath(URL url) {
        return root + url.getServiceInterface();
    }
    private String toCategoryPath(URL url) {
        return toServicePath(url) + Constants.PATH_SEPARATOR + url.getParameter(Constants.CATEGORY_KEY, Constants.DEFAULT_CATEGORY);
    }
    private class NotifySub extends JedisPubSub {
        private final JedisPool jedisPool;
        public NotifySub(JedisPool jedisPool) {
            this.jedisPool = jedisPool;
        }
        @Override
        public void onMessage(String key, String msg) {
            if (logger.isInfoEnabled()) {
                logger.info("redis event: " + key + " = " + msg);
            }
            if (msg.equals(Constants.REGISTER)
                    || msg.equals(Constants.UNREGISTER)) {
                try {
                    Jedis jedis = jedisPool.getResource();
                    try {
                        doNotify(jedis, key);
                    } finally {