[vlc-commits] dash: Chunk: Avoiding copies + cosmetics

Hugo Beauzée-Luyssen git at videolan.org
Mon Nov 28 20:24:31 CET 2011


vlc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Fri Nov 25 17:00:25 2011 +0100| [f4600d0e6f9482911de1e40cb22e517088ee0962] | committer: Jean-Baptiste Kempf

dash: Chunk: Avoiding copies + cosmetics

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f4600d0e6f9482911de1e40cb22e517088ee0962
---

 modules/stream_filter/dash/http/Chunk.cpp |   17 +++++++----------
 modules/stream_filter/dash/http/Chunk.h   |   13 ++++++-------
 2 files changed, 13 insertions(+), 17 deletions(-)

diff --git a/modules/stream_filter/dash/http/Chunk.cpp b/modules/stream_filter/dash/http/Chunk.cpp
index 79eb74c..56d02d4 100644
--- a/modules/stream_filter/dash/http/Chunk.cpp
+++ b/modules/stream_filter/dash/http/Chunk.cpp
@@ -29,24 +29,21 @@
 
 using namespace dash::http;
 
-Chunk::Chunk() : url()
-
-{
-    startByte = endByte = 0;
-}
-Chunk::~Chunk()
+Chunk::Chunk() : startByte( 0 ),
+    endByte( 0 )
 {
 }
 
-int         Chunk::getEndByte   ()
+int         Chunk::getEndByte   () const
 {
     return endByte;
 }
-int         Chunk::getStartByte ()
+int         Chunk::getStartByte () const
 {
     return startByte;
 }
-std::string Chunk::getUrl       ()
+
+const std::string& Chunk::getUrl       () const
 {
     return url;
 }
@@ -58,7 +55,7 @@ void        Chunk::setStartByte (int startByte)
 {
     this->startByte = startByte;
 }
-void        Chunk::setUrl       (std::string url)
+void        Chunk::setUrl       ( const std::string& url )
 {
     this->url = url;
 }
diff --git a/modules/stream_filter/dash/http/Chunk.h b/modules/stream_filter/dash/http/Chunk.h
index 07055c3..0409fd5 100644
--- a/modules/stream_filter/dash/http/Chunk.h
+++ b/modules/stream_filter/dash/http/Chunk.h
@@ -36,14 +36,13 @@ namespace dash
         {
             public:
                 Chunk           ();
-                virtual ~Chunk  ();
 
-                int         getEndByte      ();
-                int         getStartByte    ();
-                std::string getUrl          ();
-                void        setEndByte      (int endByte);
-                void        setStartByte    (int startByte);
-                void        setUrl          (std::string url);
+                int                 getEndByte      () const;
+                int                 getStartByte    () const;
+                const std::string&  getUrl          () const;
+                void                setEndByte      (int endByte);
+                void                setStartByte    (int startByte);
+                void                setUrl          (const std::string& url);
 
             private:
                 std::string                 url;



More information about the vlc-commits mailing list