summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2009-12-07 20:37:37 +0100
committerJose <jose@zeroc.com>2009-12-07 20:37:37 +0100
commitb78ae713c2be4770a1b5d564c72fc9afb7c25030 (patch)
tree7d4aedc7acaa13c5ef99f6ec15057620d333f241 /cpp/src
parenthttp://bugzilla/bugzilla/show_bug.cgi?id=4391 - test/Ice/udp fails under SL (... (diff)
downloadice-b78ae713c2be4770a1b5d564c72fc9afb7c25030.tar.bz2
ice-b78ae713c2be4770a1b5d564c72fc9afb7c25030.tar.xz
ice-b78ae713c2be4770a1b5d564c72fc9afb7c25030.zip
4413 - .NET Do not cast unnecessarily.
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/slice2cs/Gen.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp
index 4dc49f80d59..c012fc1fbae 100644
--- a/cpp/src/slice2cs/Gen.cpp
+++ b/cpp/src/slice2cs/Gen.cpp
@@ -2532,7 +2532,8 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p)
_out << sb;
_out << nl << "return true;";
_out << eb;
- _out << nl << "if(!(other__ is " << name << "))";
+ _out << nl << name << " o__ = other__ as " << name << ";";
+ _out << nl << "if(o__ == null)";
_out << sb;
_out << nl << "return false;";
_out << eb;
@@ -2543,10 +2544,6 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p)
_out << nl << "return false;";
_out << eb;
}
- if(!dataMembers.empty())
- {
- _out << nl << name << " o__ = (" << name << ")other__;";
- }
writeMemberEquals(dataMembers, DotNet::Exception);
_out << nl << "return true;";
_out << eb;