rspec/rules/S1652/vb6/rule.adoc

33 lines
496 B
Plaintext
Raw Normal View History

== Why is this an issue?
2021-04-28 16:49:39 +02:00
Because the value returned never changes, it is inefficient to call ``++Asc++``/``++AscW++`` on a String constant. Use the numeric value instead.
=== Noncompliant code example
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,vb6]
2021-04-28 16:49:39 +02:00
----
intCode = Asc("*")
----
=== Compliant solution
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,vb6]
2021-04-28 16:49:39 +02:00
----
intCode = 42
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Use the numeric value of X instead
endif::env-github,rspecator-view[]