bcgit / pc-dart

Pointy Castle - Dart Derived Bouncy Castle APIs
MIT License
237 stars 123 forks source link

remove unnecessary ! operator from some files #236

Closed hassony105 closed 5 months ago

hassony105 commented 5 months ago

Hello, I have made this commit and pull request because of these warnings:

[WARN] ../../AppData/Local/Pub/Cache/hosted/pub.dev/pointycastle-3.9.0/lib/macs/cbc_block_cipher_mac.dart:103:46: Warning: Operand of null-aware operation '!' has type 'Padding' which excludes null.
 - 'Padding' is from 'package:pointycastle/api.dart' ('../../AppData/Local/Pub/Cache/hosted/pub.dev/pointycastle-3.9.0/lib/api.dart').
    var paddingName = _padding != null ? '/${_padding!.algorithmName}' : '';
                                             ^
[WARN] ../../AppData/Local/Pub/Cache/hosted/pub.dev/pointycastle-3.9.0/lib/macs/cbc_block_cipher_mac.dart:203:7: Warning: Operand of null-aware operation '!' has type 'Padding' which excludes null.
 - 'Padding' is from 'package:pointycastle/api.dart' ('../../AppData/Local/Pub/Cache/hosted/pub.dev/pointycastle-3.9.0/lib/api.dart').
      _padding!.addPadding(_buf, _bufOff);
      ^
[WARN] ../../AppData/Local/Pub/Cache/hosted/pub.dev/pointycastle-3.9.0/lib/signers/ecdsa_signer.dart:94:41: Warning: Operand of null-aware operation '!' has type 'Mac' which excludes null.
 - 'Mac' is from 'package:pointycastle/api.dart' ('../../AppData/Local/Pub/Cache/hosted/pub.dev/pointycastle-3.9.0/lib/api.dart').
      kCalculator = _RFC6979KCalculator(_kMac!, n, _pvkey!.d!, message);
                                        ^
[WARN] ../../AppData/Local/Pub/Cache/hosted/pub.dev/pointycastle-3.9.0/lib/signers/ecdsa_signer.dart:166:7: Warning: Operand of null-aware operation '!' has type 'Digest' which excludes null.
 - 'Digest' is from 'package:pointycastle/api.dart' ('../../AppData/Local/Pub/Cache/hosted/pub.dev/pointycastle-3.9.0/lib/api.dart').
      _digest!.reset();
      ^
../../AppData/Local/Pub/Cache/hosted/pub.dev/pointycastle-3.9.0/lib/signers/ecdsa_signer.dart:167:14: Warning: Operand of null-aware operation '!' has type 'Digest' which excludes null.
 - 'Digest' is from 'package:pointycastle/api.dart' ('../../AppData/Local/Pub/Cache/hosted/pub.dev/pointycastle-3.9.0/lib/api.dart').
      return _digest!.process(message);
             ^

so I have removed the unnecessary ! operator from those files.

AlexDochioiu commented 5 months ago

@Ephenodrom Would be great to get this PR merged. Those warnings are rather annoying.

Ephenodrom commented 5 months ago

@AlexDochioiu will try to get this merged and live within the next 2 days. I keep you updated @hassony105 Thanks for the PR.

hassony105 commented 5 months ago

@Ephenodrom glad to helping