Exit Function

exit(bool status) terminates contract execution. If status is true, the contract succeeds; otherwise, it fails.

contract TestPositiveEqual {
    int x;

    constructor(int x) {
        this.x = x;
    }

    public function equal(int y) {
        if (y <= 0) {
          exit(true);
        }
        require(y == this.x);
    }
}