Author: mdiep
Date: Tue May 1 22:39:08 2007
New Revision: 18388
Modified:
trunk/src/objects.c
Log:
A couple small, obvious time savers
Modified: trunk/src/objects.c
==============================================================================
--- trunk/src/objects.c (original)
+++ trunk/src/objects.c Tue May 1 22:39:08 2007
@@ -143,7 +143,6 @@
static void
fail_if_exist(Interp *interp, PMC *name)
{
- STRING *class_name;
INTVAL type;
PMC * const classname_hash = interp->class_hash;
@@ -154,9 +153,10 @@
type = 0;
else
type = VTABLE_get_integer(interp, type_pmc);
- /* TODO get printable name */
- class_name = VTABLE_get_string(interp, name);
+
if (type > enum_type_undef) {
+ /* TODO get printable name */
+ STRING *class_name = VTABLE_get_string(interp, name);
real_exception(interp, NULL, INVALID_OPERATION,
"Class %Ss already registered!\n", class_name);
}
@@ -651,7 +651,6 @@
* The child class PMC gets the vtable of its parent class or
* a ParrotClass vtable
*/
- parent_vtable = new_class->vtable;
if (parent && PObj_is_class_TEST(parent))
parent_vtable = parent->vtable;
else