Skip to content

Commit

Permalink
reverse if condition to simplify reading
Browse files Browse the repository at this point in the history
  • Loading branch information
Lagovas committed Apr 28, 2022
1 parent 7f81eb0 commit 8e8a347
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions decryptor/postgresql/data_encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ func (p *PgSQLDataEncoderProcessor) encodeToValue(ctx context.Context, data []by
// values. If it was decrypted then we return it as valid bytea value
// If it wasn't decrypted (due to inappropriate keys or not AcraStructs as payload) then we return it in same way
// as it come to us.
if !base.IsDecryptedFromContext(ctx) {
if base.IsDecryptedFromContext(ctx) {
return ctx, &byteSequenceValue{seq: data}, nil
} else {
encodedValue, ok := getEncodedValueFromContext(ctx)
if ok {
return ctx, &identityValue{encodedValue}, nil
}
} else {
return ctx, &byteSequenceValue{seq: data}, nil
}
return ctx, &identityValue{data}, nil
}
Expand Down

0 comments on commit 8e8a347

Please sign in to comment.