ASN1: little optimization for better performance.

This commit is contained in:
Patrick Monnerat 2012-10-25 17:54:02 +02:00
parent c1c9c38fe6
commit 64c3b309bd

View File

@ -241,6 +241,11 @@ class File_ASN1 {
*/ */
function decodeBER($encoded) function decodeBER($encoded)
{ {
if (is_object($encoded) && strtolower(get_class($encoded)) == 'file_asn1_element') {
$encoded = $encoded->element;
}
$this->encoded = $encoded;
return $this->_decode_ber($encoded); return $this->_decode_ber($encoded);
} }
@ -260,14 +265,6 @@ class File_ASN1 {
{ {
$decoded = array(); $decoded = array();
if (is_object($encoded) && strtolower(get_class($encoded)) == 'file_asn1_element') {
$encoded = $encoded->element;
}
if ($start == 0) {
$this->encoded = $encoded;
}
while ( strlen($encoded) ) { while ( strlen($encoded) ) {
$current = array('start' => $start); $current = array('start' => $start);