[minor]Reduce redundancy (#6611)

This PR fixes the following four kinds of redundancy:
- redundant collection operations 
- redundant string operation
- redundant type cast 
- redundant array creation
7 files changed
tree: a8945d23527add8ac1a68e2cfcdb7e5d3c3fb9cb
  1. pulsar-io/