diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-08-14 19:51:53 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-08-14 19:51:53 +0000 |
commit | 913ee123deea873b7f84129e426385d8c9c75f59 (patch) | |
tree | f29510548986352f30aa84b4b2da2c73c1ea648d | |
parent | 06fd29d5b078fef57cad7cf0037c12e4d91226d1 (diff) | |
download | libextractor-913ee123deea873b7f84129e426385d8c9c75f59.tar.gz libextractor-913ee123deea873b7f84129e426385d8c9c75f59.zip |
reducing strlen calls
-rw-r--r-- | src/plugins/asf_extractor.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/plugins/asf_extractor.c b/src/plugins/asf_extractor.c index b6fb981..ea8b803 100644 --- a/src/plugins/asf_extractor.c +++ b/src/plugins/asf_extractor.c | |||
@@ -735,6 +735,7 @@ EXTRACTOR_asf_extract (const char *data, | |||
735 | const char *options) | 735 | const char *options) |
736 | { | 736 | { |
737 | demux_asf_t this; | 737 | demux_asf_t this; |
738 | size_t slen; | ||
738 | 739 | ||
739 | memset (&this, 0, sizeof (demux_asf_t)); | 740 | memset (&this, 0, sizeof (demux_asf_t)); |
740 | this.input = data; | 741 | this.input = data; |
@@ -743,38 +744,38 @@ EXTRACTOR_asf_extract (const char *data, | |||
743 | if (0 == asf_read_header (&this)) | 744 | if (0 == asf_read_header (&this)) |
744 | return 0; | 745 | return 0; |
745 | 746 | ||
746 | if ( ( (strlen(this.title) > 0) && | 747 | if ( ( (0 < (slen = strlen(this.title))) && |
747 | (0 != proc (proc_cls, | 748 | (0 != proc (proc_cls, |
748 | "asf", | 749 | "asf", |
749 | EXTRACTOR_METATYPE_TITLE, | 750 | EXTRACTOR_METATYPE_TITLE, |
750 | EXTRACTOR_METAFORMAT_C_STRING, | 751 | EXTRACTOR_METAFORMAT_C_STRING, |
751 | "text/plain", | 752 | "text/plain", |
752 | this.title, | 753 | this.title, |
753 | strlen(this.title) + 1)) ) || | 754 | slen + 1)) ) || |
754 | ( (strlen(this.author) > 0) && | 755 | ( (0 < (slen = strlen(this.author))) && |
755 | (0 != proc (proc_cls, | 756 | (0 != proc (proc_cls, |
756 | "asf", | 757 | "asf", |
757 | EXTRACTOR_METATYPE_AUTHOR_NAME, | 758 | EXTRACTOR_METATYPE_AUTHOR_NAME, |
758 | EXTRACTOR_METAFORMAT_C_STRING, | 759 | EXTRACTOR_METAFORMAT_C_STRING, |
759 | "text/plain", | 760 | "text/plain", |
760 | this.author, | 761 | this.author, |
761 | strlen(this.author) + 1)) ) || | 762 | slen + 1)) ) || |
762 | ( (strlen(this.comment) > 0) && | 763 | ( (0 < (slen = strlen(this.comment))) && |
763 | (0 != proc (proc_cls, | 764 | (0 != proc (proc_cls, |
764 | "asf", | 765 | "asf", |
765 | EXTRACTOR_METATYPE_COMMENT, | 766 | EXTRACTOR_METATYPE_COMMENT, |
766 | EXTRACTOR_METAFORMAT_C_STRING, | 767 | EXTRACTOR_METAFORMAT_C_STRING, |
767 | "text/plain", | 768 | "text/plain", |
768 | this.comment, | 769 | this.comment, |
769 | strlen(this.comment) + 1)) ) || | 770 | slen + 1)) ) || |
770 | ( (strlen(this.copyright) > 0) && | 771 | ( (0 < (slen = strlen(this.copyright))) && |
771 | (0 != proc (proc_cls, | 772 | (0 != proc (proc_cls, |
772 | "asf", | 773 | "asf", |
773 | EXTRACTOR_METATYPE_COPYRIGHT, | 774 | EXTRACTOR_METATYPE_COPYRIGHT, |
774 | EXTRACTOR_METAFORMAT_C_STRING, | 775 | EXTRACTOR_METAFORMAT_C_STRING, |
775 | "text/plain", | 776 | "text/plain", |
776 | this.copyright, | 777 | this.copyright, |
777 | strlen(this.copyright) + 1)) ) || | 778 | slen + 1)) ) || |
778 | (0 != proc (proc_cls, | 779 | (0 != proc (proc_cls, |
779 | "asf", | 780 | "asf", |
780 | EXTRACTOR_METATYPE_MIMETYPE, | 781 | EXTRACTOR_METATYPE_MIMETYPE, |