[go: up one dir, main page]

Menu

#12 Remove redundant dynamic_cast

closed
nobody
None
True
2015-09-10
2015-09-01
No

GDriveFolder::createDocument() is slightly inefficient. A GDriveDocument object is created and given to a shared_ptr<Document> (i.e. an upcast to the base pointer type) and then dynamic_pointer_cast is used to downcast to another shared_ptr.

If the object is just stored in the right type in the first place then there is no need for an expensive dynamic_cast and an additional reference-count increment inside the shared_ptr.

1 Attachments

Discussion

  • Cedric Bosdonnat

    Patch in master. Thanks for the fix.

     
  • Cedric Bosdonnat

    • status: open --> closed
     

Log in to post a comment.