From c0c89c306cf6f9d0c12604183d625426e7b8b1b6 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Thu, 14 May 2015 01:01:52 +0300 Subject: [PATCH] Remove useless swap() code --- libgrive/src/drive/Entry.cc | 23 ----------------------- libgrive/src/drive/Entry.hh | 2 -- libgrive/src/drive/Resource.cc | 28 ---------------------------- libgrive/src/drive/Resource.hh | 8 -------- libgrive/src/drive/ResourceTree.cc | 12 ------------ libgrive/src/drive/ResourceTree.hh | 3 --- 6 files changed, 76 deletions(-) diff --git a/libgrive/src/drive/Entry.cc b/libgrive/src/drive/Entry.cc index 23165d8..506295e 100644 --- a/libgrive/src/drive/Entry.cc +++ b/libgrive/src/drive/Entry.cc @@ -152,29 +152,6 @@ std::string Entry::CreateLink() const return m_create_link ; } -void Entry::Swap( Entry& e ) -{ - m_title.swap( e.m_title ) ; - m_filename.swap( e.m_filename ) ; - m_kind.swap( e.m_kind ) ; - m_md5.swap( e.m_md5 ) ; - m_etag.swap( e.m_etag ) ; - m_resource_id.swap( e.m_resource_id ) ; - - m_parent_hrefs.swap( e.m_parent_hrefs ) ; - - m_self_href.swap( e.m_self_href ) ; - m_alt_self.swap( e.m_alt_self ) ; - m_content_src.swap( e.m_content_src ) ; - m_edit_link.swap( e.m_edit_link ) ; - m_create_link.swap( e.m_create_link ) ; - - m_mtime.Swap( e.m_mtime ) ; - - std::swap( m_change_stamp, e.m_change_stamp ) ; - std::swap( m_is_removed, e.m_is_removed ) ; -} - long Entry::ChangeStamp() const { return m_change_stamp ; diff --git a/libgrive/src/drive/Entry.hh b/libgrive/src/drive/Entry.hh index b7e9293..a059b4f 100644 --- a/libgrive/src/drive/Entry.hh +++ b/libgrive/src/drive/Entry.hh @@ -71,8 +71,6 @@ public : const std::vector& ParentHrefs() const ; - void Swap( Entry& e ) ; - void Update( const xml::Node& entry ) ; private : diff --git a/libgrive/src/drive/Resource.cc b/libgrive/src/drive/Resource.cc index 4010cab..8974508 100644 --- a/libgrive/src/drive/Resource.cc +++ b/libgrive/src/drive/Resource.cc @@ -314,26 +314,6 @@ void Resource::AddChild( Resource *child ) m_child.push_back( child ) ; } -void Resource::Swap( Resource& coll ) -{ - m_name.swap( coll.m_name ) ; - m_kind.swap( coll.m_kind ) ; - m_md5.swap( coll.m_md5 ) ; - m_etag.swap( coll.m_etag ) ; - m_id.swap( coll.m_id ) ; - - m_href.swap( coll.m_href ) ; - m_content.swap( coll.m_content ) ; - m_edit.swap( coll.m_edit ) ; - m_create.swap( coll.m_create ) ; - - m_mtime.Swap( coll.m_mtime ) ; - - std::swap( m_parent, coll.m_parent ) ; - m_child.swap( coll.m_child ) ; - std::swap( m_state, coll.m_state ) ; -} - bool Resource::IsFolder() const { return m_kind == "folder" ; @@ -669,11 +649,3 @@ bool Resource::HasID() const } } } // end of namespace - -namespace std -{ - void swap( gr::v1::Resource& c1, gr::v1::Resource& c2 ) - { - c1.Swap( c2 ) ; - } -} diff --git a/libgrive/src/drive/Resource.hh b/libgrive/src/drive/Resource.hh index 4609680..190518e 100644 --- a/libgrive/src/drive/Resource.hh +++ b/libgrive/src/drive/Resource.hh @@ -57,9 +57,6 @@ public : Resource(const fs::path& root_folder) ; Resource( const std::string& name, const std::string& kind ) ; - // default copy ctor & op= are fine - void Swap( Resource& coll ) ; - bool IsFolder() const ; std::string Name() const ; @@ -162,8 +159,3 @@ private : } ; } } // end of namespace gr::v1 - -namespace std -{ - void swap( gr::v1::Resource& c1, gr::v1::Resource& c2 ) ; -} diff --git a/libgrive/src/drive/ResourceTree.cc b/libgrive/src/drive/ResourceTree.cc index 4a8a6da..d806232 100644 --- a/libgrive/src/drive/ResourceTree.cc +++ b/libgrive/src/drive/ResourceTree.cc @@ -80,18 +80,6 @@ const Resource* ResourceTree::Root() const return m_root ; } -void ResourceTree::Swap( ResourceTree& fs ) -{ - m_set.swap( fs.m_set ) ; -} - -ResourceTree& ResourceTree::operator=( const ResourceTree& fs ) -{ - ResourceTree tmp( fs ) ; - Swap( tmp ) ; - return *this ; -} - Resource* ResourceTree::FindByHref( const std::string& href ) { // for the resource that not yet have href (e.g. not yet fetched from server) diff --git a/libgrive/src/drive/ResourceTree.hh b/libgrive/src/drive/ResourceTree.hh index 212141a..6bd1501 100644 --- a/libgrive/src/drive/ResourceTree.hh +++ b/libgrive/src/drive/ResourceTree.hh @@ -70,9 +70,6 @@ public : ResourceTree( const ResourceTree& fs ) ; ~ResourceTree( ) ; - void Swap( ResourceTree& fs ) ; - ResourceTree& operator=( const ResourceTree& fs ) ; - Resource* FindByHref( const std::string& href ) ; const Resource* FindByHref( const std::string& href ) const ;