]> git.lyx.org Git - lyx.git/blobdiff - src/support/StrPool.C
lyxserver cleanup patch + andre's small patches
[lyx.git] / src / support / StrPool.C
index 2bbc1e06f085d748d827eb278878979d42e465b6..5a81c1e6cf3c2aa44b70363337758e54376cc487 100644 (file)
@@ -1,10 +1,9 @@
-// -*- C++ -*-
 /* This file is part of
  * ======================================================
  * 
  *           LyX, The Document Processor
  *      
- *          Copyright 2000 Jean-Marc Lasgouttes
+ *          Copyright 2000-2001 Jean-Marc Lasgouttes
  *
  * ======================================================*/
 
@@ -15,6 +14,7 @@
 #include <config.h>
 #include "StrPool.h"
 
+
 StrPool::~StrPool()
 {
         for (Pool::const_iterator cit = pool_.begin(); 
@@ -23,9 +23,14 @@ StrPool::~StrPool()
         }
 }
 
+/* One interesting thing here would be to store the strings in a map,
+   so that one string is only stored once. This would make things a
+   bit slower, but memory requirements would be lower in the long run.
+   I expect that it would be fast enough anyway. (Lgb)
+*/
 char const * StrPool::add(string const & str)
 {
-       int s = str.length();
+       string::size_type s = str.length();
         char * buf = new char [s + 1];
         str.copy(buf, s);
         buf[s] = '\0';
@@ -33,3 +38,5 @@ char const * StrPool::add(string const & str)
         return buf;
 }
 
+//StrPool strPool;
+