Wie soll ich „CS0642: Mögliche falsche leere Anweisung“ in diesem Codesegment vermeiden?C#

Ein Treffpunkt für C#-Programmierer
Anonymous
 Wie soll ich „CS0642: Mögliche falsche leere Anweisung“ in diesem Codesegment vermeiden?

Post by Anonymous »

Ich habe der Übersichtlichkeit halber nur die relevanten Teile eingefügt.

Code: Select all

void UpdateObjectState()
{
bool conditionA = ...
bool conditionB = ...
bool conditionC = ...

myObject.SetDefaultState();

// One of the Logic functions gets called here based on some conditions

void LogicA() ...
void LogicB() ...
void LogicC()
{
if      (conditionA) myObject.ChangeStateA();
else if (conditionB) /*no op*/; //

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post