# Code error or redundant code? **Category:** [Technical (archive)](https://discourse.openehr.org/c/technical-archive/156) **Created:** 2008-12-19 16:28 UTC **Views:** 16 **Replies:** 1 **URL:** https://discourse.openehr.org/t/code-error-or-redundant-code/12712 --- ## Post #1 by @Oxford_Partnership In the following code [http://www.openehr.org/svn/knowledge_tools_dotnet/TRUNK/ArchetypeEditor/BusinessLogic/openEHR/History/RmEvent.vb](http://www.openehr.org/svn/knowledge_tools_dotnet/TRUNK/ArchetypeEditor/BusinessLogic/openEHR/History/RmEvent.vb) there exists the following Public Overrides Function Copy() As RmStructure Dim ae As New RmEvent(Me.NodeId) ae.cOccurrences = Me.cOccurrences ae.mType = mType ae.sNodeId = Me.sNodeId ae.mRunTimeConstraint = Me.mRunTimeConstraint ae.iOffset = Me.iOffset ae.sOffset = Me.sOffset ae.iWidth = Me.iWidth ae.sWidth = Me.sWidth ae.mEventType = Me.EventType ae.boolSignNeg = Me.boolSignNeg ae.boolFixedDuration = Me.boolFixedDuration ae.boolFixedOffset = ae.boolFixedOffset Return ae End Function is the following line an error?, why set it to itself? ae.boolFixedOffset = ae.boolFixedOffset --- ## Post #2 by @Peter_Gummer1 Oxford Partnership wrote: > In the following code > > http://www.openehr.org/svn/knowledge_tools_dotnet/TRUNK/ArchetypeEditor/BusinessLogic/openEHR/History/RmEvent.vb > >         \.\.\. > is the following line an error?, why set it to itself? > > ae\.boolFixedOffset = ae\.boolFixedOffset It's clearly a bug, isn't it? As far as I can see nothing calls that method\. Normally I would delete unused code, but in this case I imagine it might be useful for implementing copy and paste in Archetype Editor, so rather than delete it I've fixed the bug\. Thanks for noticing it\. \- Peter --- **Canonical:** https://discourse.openehr.org/t/code-error-or-redundant-code/12712 **Original content:** https://discourse.openehr.org/t/code-error-or-redundant-code/12712