Hi Atul, you are perfectly right about this refactoring!
If we go a step further we can get rid of type() altogether and use the RTTI instead. For example:
if (typeid (*item) != typeid (BString))
...
I guess that typeid() is just like a virtual call anyway, so it will not be less efficient. We can get rid of type() functions in a number of classes ;-)
Is there something with typeid() I’m missing? Let me know what you think?
Best regards,
Peter
atul wrote:Dear all
While reading BDecoder code, I came upon this class. I think we are storing redundant type info here….
Here is a patch that removes a lot of code
Let me know..
Btw, I generated the patch thru bzr… This is a superb tool, thanks Peter for introducing me to it… I am going to try the vimdiff plugin today some time… ;-)
—cheers atul
