compiler warning at nsStaticNameTable.cpp:88

RESOLVED FIXED

Status

()

RESOLVED FIXED
17 years ago
17 years ago

People

(Reporter: bryner, Assigned: alecf)

Tracking

Trunk
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

17 years ago
nsStaticNameTable.cpp: In method `PRBool nsStaticCaseInsensitiveNameTable::Init
(const char **, int)':
nsStaticNameTable.cpp:88: warning: unused variable `nsDependentCString *str'


alec, I don't think we need to assign the result of the placement-new into a
variable here.  Suggested fix:

--- nsStaticNameTable.cpp	17 Dec 2001 07:06:36 -0000	1.8
+++ nsStaticNameTable.cpp	17 Feb 2002 01:32:57 -0000
@@ -84,9 +84,8 @@
        NS_ASSERTION(temp1.Equals(temp2), "upper case char in table");
        }
 #endif
-       // use placement-new to initialize the string object
-       nsDependentCString *str =
-         new (&mNameArray[index]) nsDependentCString(raw);
+        // use placement-new to initialize the string object
+        new (&mNameArray[index]) nsDependentCString(raw);
         nsCStringKey key(raw, len, nsCStringKey::NEVER_OWN);
         mNameTable->Put(&key, (void*)(index+1)); // to make 0 != nsnull
     }
r=bzbarsky
(Assignee)

Comment 2

17 years ago
ah, you're right. sr=alecf if you feel like checking that in
(Reporter)

Comment 3

17 years ago
checked in.
Status: NEW → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.