4 added 2 characters in body
source | link

If you use "early return," you can avoid the BooleanBoolean variable and break statements entirely.

public static Boolean myCheck(List<sObject> triggerOld, List<sObject> triggerNew){

    for(sObject oldInfo: triggerOld){
        for(sObject newInfo: triggerNew){
            if(newInfo.Id == oldInfo.Id && newInfo.Name != oldInfo.Name){
                return true;
            }
        }
    }

    return false;
}

See Also
Computer Programming/Coding Style/Minimize Nesting/Early Return

If you use "early return," you can avoid the Boolean variable and break statements entirely.

public static Boolean myCheck(List<sObject> triggerOld, List<sObject> triggerNew){

    for(sObject oldInfo: triggerOld){
        for(sObject newInfo: triggerNew){
            if(newInfo.Id == oldInfo.Id && newInfo.Name != oldInfo.Name){
                return true;
            }
        }
    }

    return false;
}

See Also
Computer Programming/Coding Style/Minimize Nesting/Early Return

If you use "early return," you can avoid the Boolean variable and break statements entirely.

public static Boolean myCheck(List<sObject> triggerOld, List<sObject> triggerNew){

    for(sObject oldInfo: triggerOld){
        for(sObject newInfo: triggerNew){
            if(newInfo.Id == oldInfo.Id && newInfo.Name != oldInfo.Name){
                return true;
            }
        }
    }

    return false;
}

See Also
Computer Programming/Coding Style/Minimize Nesting/Early Return

3 added 11 characters in body
source | link

If you use "early return," you can avoid the Boolean variable and breaksbreak statements entirely.

public static Boolean myCheck(List<sObject> triggerOld, List<sObject> triggerNew){

    for(sObject oldInfo: triggerOld){
        for(sObject newInfo: triggerNew){
            if(newInfo.Id == oldInfo.Id && newInfo.Name != oldInfo.Name){
                return true;
            }
        }
    }

    return false;
}

See Also
Computer Programming/Coding Style/Minimize Nesting/Early Return

If you use "early return," you can avoid the Boolean variable and breaks entirely.

public static Boolean myCheck(List<sObject> triggerOld, List<sObject> triggerNew){

    for(sObject oldInfo: triggerOld){
        for(sObject newInfo: triggerNew){
            if(newInfo.Id == oldInfo.Id && newInfo.Name != oldInfo.Name){
                return true;
            }
        }
    }

    return false;
}

If you use "early return," you can avoid the Boolean variable and break statements entirely.

public static Boolean myCheck(List<sObject> triggerOld, List<sObject> triggerNew){

    for(sObject oldInfo: triggerOld){
        for(sObject newInfo: triggerNew){
            if(newInfo.Id == oldInfo.Id && newInfo.Name != oldInfo.Name){
                return true;
            }
        }
    }

    return false;
}

See Also
Computer Programming/Coding Style/Minimize Nesting/Early Return

2 added 11 characters in body
source | link

If you use "early return," you can avoid the Boolean variable and breaks entirely.

public static Boolean myCheck(List<sObject> triggerOld, List<sObject> triggerNew){

    for(sObject oldInfo: triggerOld){
        for(sObject newInfo: triggerNew){
            if(newInfo.Id == oldInfo.Id && newInfo.Name != oldInfo.Name){
                return true;
            }
        }
    }

    return false;
}

If you use "early return," you can avoid the Boolean variable entirely.

public static Boolean myCheck(List<sObject> triggerOld, List<sObject> triggerNew){

    for(sObject oldInfo: triggerOld){
        for(sObject newInfo: triggerNew){
            if(newInfo.Id == oldInfo.Id && newInfo.Name != oldInfo.Name){
                return true;
            }
        }
    }

    return false;
}

If you use "early return," you can avoid the Boolean variable and breaks entirely.

public static Boolean myCheck(List<sObject> triggerOld, List<sObject> triggerNew){

    for(sObject oldInfo: triggerOld){
        for(sObject newInfo: triggerNew){
            if(newInfo.Id == oldInfo.Id && newInfo.Name != oldInfo.Name){
                return true;
            }
        }
    }

    return false;
}
1
source | link