Subject: * generic/tclObj.c (Tcl_GetStringFromObj): Reduce code duplication.

From: dgp <[email-masked]>
Date: Tue, 3 Feb 2009 17:15:28 +0000

---
 ChangeLog        |  4 ++++
 generic/tclObj.c | 10 ++--------
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 095a210..af279be 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-02-03  Don Porter  <[email-masked]>
+
+	* generic/tclObj.c (Tcl_GetStringFromObj): Reduce code duplication.
+
 2009-02-02  Don Porter  <[email-masked]>
 
 	* generic/tclInterp.c:	Reverted the conversion of [interp] into an
diff --git a/generic/tclObj.c b/generic/tclObj.c
index 2b2219a..93cf2f4 100644
--- a/generic/tclObj.c
+++ b/generic/tclObj.c
@@ -13,7 +13,7 @@
  * See the file "license.terms" for information on usage and redistribution of
  * this file, and for a DISCLAIMER OF ALL WARRANTIES.
  *
- * RCS: @(#) $Id: tclObj.c,v 1.147 2009/01/09 11:21:46 dkf Exp $
+ * RCS: @(#) $Id: tclObj.c,v 1.148 2009/02/03 17:15:28 dgp Exp $
  */
 
 #include "tclInt.h"
@@ -1099,13 +1099,7 @@ Tcl_GetStringFromObj(
 				 * rep's byte array length should * be stored.
 				 * If NULL, no length is stored. */
 {
-    if (objPtr->bytes == NULL) {
-	if (objPtr->typePtr->updateStringProc == NULL) {
-	    Tcl_Panic("UpdateStringProc should not be invoked for type %s",
-		    objPtr->typePtr->name);
-	}
-	objPtr->typePtr->updateStringProc(objPtr);
-    }
+    (void) TclGetString(objPtr);
 
     if (lengthPtr != NULL) {
 	*lengthPtr = objPtr->length;
-- 
cgit v0.12