On 2/22/2014 5:22 PM, Justin Dolske wrote:
But really, the best way to fix this would be to use a macro:

  err = SSLHashSHA1.update(&hashCtx, &foo);
  SSL_ENSURE_SUCCESS(err, err);
  err = SSLHashSHA1.update(&hashCtx, &bar);
  SSL_ENSURE_SUCCESS(err, err);
  err = SSLHashSHA1.update(&hashCtx, &baz);
  SSL_ENSURE_SUCCESS(err, err);

Ok, maybe I'm not being entirely serious. :P

Being serious here, early-return and RTTI (to handle the cleanup prior to exit) would have eliminated the need for gotos in the first place.

--
Joshua Cranmer
Thunderbird and DXR developer
Source code archæologist

_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to