From 53a3c76a2aba4106105eda2e7745abd32021c138 Mon Sep 17 00:00:00 2001 From: Dave Schuyler Date: Fri, 11 Jul 2003 23:02:58 +0000 Subject: [PATCH] percent_used to fraction_used --- panda/src/putil/uniqueIdAllocator.cxx | 12 ++++++------ panda/src/putil/uniqueIdAllocator.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/panda/src/putil/uniqueIdAllocator.cxx b/panda/src/putil/uniqueIdAllocator.cxx index 19618e4bb7..bc94837c84 100644 --- a/panda/src/putil/uniqueIdAllocator.cxx +++ b/panda/src/putil/uniqueIdAllocator.cxx @@ -110,7 +110,7 @@ allocate() { //////////////////////////////////////////////////////////////////// -// Function: +// Function: free // Access: // Description: Free an allocated index (index must be between _min // and _max that were passed to the constructor). @@ -134,19 +134,19 @@ free(U32 index) { //////////////////////////////////////////////////////////////////// -// Function: +// Function: fraction_used // Access: -// Description: return what percentage of the pool is used. The -// range is 0 to 1.0, so 75% would be 0.75, for example. +// Description: return the decimal fraction of the pool that is used. +// The range is 0 to 1.0 (e.g. 75% would be 0.75). //////////////////////////////////////////////////////////////////// float UniqueIdAllocator:: -percent_used() const { +fraction_used() const { return float(_size-_free)/_size; } //////////////////////////////////////////////////////////////////// -// Function: +// Function: output // Access: // Description: ...intended for debugging only. //////////////////////////////////////////////////////////////////// diff --git a/panda/src/putil/uniqueIdAllocator.h b/panda/src/putil/uniqueIdAllocator.h index c5615c2e84..40a7a7877b 100644 --- a/panda/src/putil/uniqueIdAllocator.h +++ b/panda/src/putil/uniqueIdAllocator.h @@ -53,7 +53,7 @@ PUBLISHED: ~UniqueIdAllocator(); U32 allocate(); void free(U32 index); - float percent_used() const; + float fraction_used() const; void output(ostream& os, bool verbose=false) const; public: