Clean up use of inline loop/conditional bodies

This commit is contained in:
Michael Hansen
2011-10-02 10:40:05 -07:00
parent db0c4c724c
commit 18a5f1082e
3 changed files with 8 additions and 4 deletions

View File

@@ -32,7 +32,8 @@ PycRef<ASTNode> BuildFromCode(PycRef<PycCode> code, PycModule* mod)
while (!source.atEof()) {
#ifdef BLOCK_DEBUG
fprintf(stderr, "%02d", pos);
for (unsigned int i = 0; i < blocks.size(); i++) fprintf(stderr, " ");
for (unsigned int i = 0; i < blocks.size(); i++)
fprintf(stderr, " ");
fprintf(stderr, "%s\n", curblock->type_str());
#endif

View File

@@ -94,7 +94,8 @@ std::string PycLong::repr() const
void PycFloat::load(PycData* stream, PycModule*)
{
int len = stream->getByte();
if (m_value) delete[] m_value;
if (m_value)
delete[] m_value;
if (len > 0) {
m_value = new char[len+1];
stream->getBuffer(len, m_value);
@@ -122,7 +123,8 @@ void PycComplex::load(PycData* stream, PycModule* mod)
PycFloat::load(stream, mod);
int len = stream->getByte();
if (m_imag) delete[] m_imag;
if (m_imag)
delete[] m_imag;
if (len > 0) {
m_imag = new char[len+1];
stream->getBuffer(len, m_imag);

View File

@@ -6,7 +6,8 @@
/* PycString */
void PycString::load(PycData* stream, PycModule* mod)
{
if (m_value) delete[] m_value;
if (m_value)
delete[] m_value;
if (type() == TYPE_STRINGREF) {
PycRef<PycString> str = mod->getIntern(stream->get32());