This is an automated email from the ASF dual-hosted git repository.

dongjoon pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/orc.git


The following commit(s) were added to refs/heads/main by this push:
     new 294a5e28f ORC-1459: Mark `DataBuffer::size()` and 
`DataBuffer::capacity()` as `const`
294a5e28f is described below

commit 294a5e28f7f0420eb1fdc76dffc33608692c1b20
Author: Valentin Lorentz <[email protected]>
AuthorDate: Fri Jun 30 18:37:46 2023 -0700

    ORC-1459: Mark `DataBuffer::size()` and `DataBuffer::capacity()` as `const`
    
    ### What changes were proposed in this pull request?
    
    These two accessors do not mutate the state, so they can be tagged as 
`const` to indicate this into callers.
    
    ### Why are the changes needed?
    
    I am writing a Rust binding, and the methods not being `const` give me 
extra constraints.
    
    ### How was this patch tested?
    
    `make test` passes.
    
    Closes #1558 from progval/DataBuffer-const-accessors.
    
    Authored-by: Valentin Lorentz <[email protected]>
    Signed-off-by: Dongjoon Hyun <[email protected]>
---
 c++/include/orc/MemoryPool.hh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/c++/include/orc/MemoryPool.hh b/c++/include/orc/MemoryPool.hh
index e9df39052..43e379442 100644
--- a/c++/include/orc/MemoryPool.hh
+++ b/c++/include/orc/MemoryPool.hh
@@ -64,11 +64,11 @@ namespace orc {
       return buf;
     }
 
-    uint64_t size() {
+    uint64_t size() const {
       return currentSize;
     }
 
-    uint64_t capacity() {
+    uint64_t capacity() const {
       return currentCapacity;
     }
 

Reply via email to